无法将所有 Flash 表单数据发送到 PHP
我有一个 Flash 表单,它将用户填写的月度报告发送到 php 文件,该文件将其发送到 MS SQL 数据库。我遇到的这个问题是,在 Flash 表单中输入任何大于 1300 个字符的内容根本不起作用。如果我将文本量减少到 1300 个字符或更少,它就会将其发送到 php 和数据库。我的研究表明,一个 flash 变量应该能够处理 65,000 个字符,当我跟踪从 flash 到 php 的输出时,所有数据都被跟踪。但是,它没有被发送到 php。我正在使用 LoadVars 通过 _GET 发送数据。那么这是 php 问题还是 flash 问题?我运行了一个 php 信息页面,我的 max_post 设置为 10M,应该足以处理此负载。我不知道为什么它不能处理超过 1300 个字符的内容。下面是我的 php 和 flash 文件的代码。
受此影响的变量是 testEvlauation、projects、support 和 programManagement 变量。我需要他们向 php 文件发送至少 8000 个字符。任何对此的帮助将不胜感激。
闪存代码:
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代码:
//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);
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);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须使用 POST。您可以通过 GET 发送的数据量受到限制。
一般来说,完整URL(包括变量名和值)的限制在2K左右,但不同系统、不同浏览器的限制不同。对于超出基本需求的情况,通过 POST 发送将允许您发送无限量(当然,在合理范围内)的数据。 (唯一的限制是服务器和可用资源施加的限制。)
You have to use POST. You are limited in the amount of data you can send via GET.
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.)