开发者

Cannot send all of flash form data to PHP

开发者 https://www.devze.com 2023-02-22 18:43 出处:网络
I have a flash form that sends a monthly report that users fill out to a php file, which sends it to a MS SQL database.This issue I am having is that anything larger then 1300 characters entered into

I have a flash form that sends a monthly report that users fill out to a php file, which sends it to a MS SQL database. This issue I am having is that anything larger then 1300 characters entered into the flash form will not work at all. If I reduce the amount of text to 1300 characters or less, it will send it to the php and database just fine. My research shows that a flash variable should be开发者_开发技巧 able to handle 65,000 characters, and when I trace my output from flash to php, all of the data is being traced. however, it is not being send to php. I am using LoadVars to send the data with _GET. So is this a php issue, or a flash issue? I ran a php info page and my max_post is set to 10M that should be enough to handle this load. I am not sure why it is not working with anything larger then 1300 characters. Below is my code for my php and flash files.

The variables that are affected by this are the testEvlauation, projects, support, and programManagement variables. I need them to send at least 8000 characters a peice to the php file. Any help with this would be appreciated.

Flash Code:

on (release) {
    sendData = new LoadVars();

sendData.contractor = contractor.text;
sendData.name = name.text;
sendData.contractNum = contractNum.text;
sendData.performance = performance.text;
sendData.manager = manager.text;
sendData.activity = activity.text;
sendData.taskNum = taskNum.text;
sendData.date = date.text;
sendData.testEvaluation = testEvaluation.text;
sendData.projects = projects.text;
sendData.support = support.text;
sendData.programManagement = programManagement.text;

sendData.send("Flash/php/MRform.php","_blank","GET");

  trace(sendData.support);

}

PHP Code:

//MS SQL SERVER CONNECTION PERAMETERS  
    $serverName = "lsv-fs-jepac1\JEPAC";  
    $uid = "SQLLogin";
    $pwd = "XXXXXXXXXXXXXXXXXXXXXX";

$connectionInfo = array("UID" => $uid, "PWD" => $pwd, "Database"=>"Requests");

/* Connect using MS SQL Credentials. */
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn ) {
echo "Connection Established.\n";
}
else {
    echo "connection could not be established.\n";
    die( print_r( sqlsrv_errors(), true));
}


/* Set up the parameterized query.*/
$name =$_GET['name'];
$contractor =$_GET['contractor'];
$contractnum =$_GET['contractNum'];
$performance =$_GET['performance'];
$manager =$_GET['manager'];
$activity =$_GET['activity'];
$taskNum =$_GET['taskNum'];
$date =$_GET['date'];
$testEvaluation =$_GET['testEvaluation'];
$projects =$_GET['projects'];
$support =$_GET['support'];
$programManagement =$_GET['programManagement'];

  $tsql = "INSERT INTO dbo.MRSup
        (Name,
         Contractor,
         ContractNum,
         Performance,
         Manager,
         Activity,
         TaskNum,
         Date,
         TestEvaluation,
         Projects,
         Support,
         ProgramManagement)
        VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";

// Set Parapter Values. 
$params = array($name, $contractor, $contractnum, $performance, $manager, $activity, $taskNum, $date, $testEvaluation, $projects, $support, $programManagement);

$stmt = sqlsrv_query( $conn, $tsql, $params);
if( $stmt ) {
    echo "Row successfully inserted.\n";
}
else {
    echo "Row instertion failed.\n";
    die (print_r( sqlsrv_errors(), true));
} 


//free statements
sqlsrv_free_stmt( $stmt); 

sqlsrv_close ($conn);


You have to use POST. You are limited in the amount of data you can send via GET.

sendData.send("Flash/php/MRform.php","_blank","POST");

Generally the limit of the full URL (including variable names and values) is around 2K, but it varies from system to system, browser to browser. For more than basic needs, sending it via POST will allow you to send an unlimited (well, within reason) amount of data. (The only limits are those imposed by the server, and available resources.)

0

精彩评论

暂无评论...
验证码 换一张
取 消