作者bingoton (忍不住一起唱 好听~)
看板PHP
标题[请益] 延续 firefox vs IE 的问题
时间Fri Jun 13 15:05:23 2008
在上一个问题,
我发现我在IE可写入资料库,
但在firefox却无法写入资料库,
最後判断到
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "fill_form"))
{
$insertSQL = sprintf("INSERT INTO questionnaire (mt_id, name, email, Area, School_name, q03, q04, q04etc, q05, q06, q07_a, q07_b, q07_c, q07_d, q07_e, q08, q08etc, q09, q09yes, q10, q11, q12, q13a, q13b, q13c, q14_a, q14_b, q14_c, bbb) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_SESSION['mt_id'], "text"),
GetSQLValueString($_POST['who_are_name'], "text"),
GetSQLValueString($_POST['who_are_email'], "text"),
GetSQLValueString($_POST['who_are_u3'], "text"),
GetSQLValueString($_POST['who_are_u34'], "text"),
GetSQLValueString($_POST['q03'], "int"),
GetSQLValueString($_POST['q04'], "int"),
GetSQLValueString($_POST['q04etc'], "text"),
GetSQLValueString($_POST['q05'], "text"),
GetSQLValueString($_POST['q06'], "int"),
GetSQLValueString($_POST['q07_a'], "int"),
...插入资料库动作
mysql_select_db($database_intel, $intel);
$Result1 = mysql_query($insertSQL, $intel) or die(mysql_error());
$insertGoTo = "test2.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
网页程式码最後的地方是
<form action="<?php echo $editFormAction; ?>" method="POST"
name="fill_form" onSubmit="return confirm_form();">
.
.
.
<input type="hidden" name="MM_insert" value="fill_form">
...
发现 在 IE环境
我可以 echo $_POST["MM_insert"]; //结果为 字串 fill_form
但在 firefox 环境
我一样 echo $_POST["MM_insert"]; //却没有显示任何值
而我试着 print_r($_POST);
在IE环境
Array (
[idno] => 1000037828 [su] => MTg4NjcyOQ== [cls] => ALL [l] => 105
[all_check] => 1,1,1,1,1,1,1,1, [all_type] => 9,9,1,1,1,1,1,1, [all_num1]
=> 16,9,2,10,2,6,8,6, [all_num2] => 5,5,,,,,9,,
[all_islmt] => 0,0,0,0,0,0,0,0, [all_lmt] => :::::::: [q15] => 3
[ck_who92] => Y [q16] => eqwe [ck_code92] => [ck_who923] => Y [q17_a] => 2008
[q17_b] => 1 [ck_code923] => [q18] => 7 [q19] => 13 [q19etc] => ewew
[q20] => 5 [q20etc] => eqwe [q21] => 3 [q21_time] => eqwe [q22c] => y
[q22d] => y [q23a1] => y
[q23b1] => y [q24] => 1 [ck_who922] => Y [q25] => dsade
[ck_code922] => [Submit2] => 下一页 [MM_update] => fill_form )
但在firefox 环境
Array ( ) 什麽东西都没有!
我觉得这是原因所在了,
导致我在 firefox存不进资料库,
但这是什麽原因,且如何解决呢?
谢谢!
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.122.193.222
※ 编辑: bingoton 来自: 140.122.193.222 (06/13 15:12)
※ 编辑: bingoton 来自: 140.122.193.222 (06/13 15:38)
1F:→ hwakeye:我决的问提出再你的表单写法有问题 06/13 16:00
2F:→ hwakeye:Server side的code不太可能跟浏览器相依… 06/13 16:01
3F:→ hwakeye:我觉得问题出在你的表单写法有问题(修正第一句推文) 06/13 16:01