[請益] submit給自己的問題
我在網路上找到一段將表單提交給自己的範例程式
但是遇到很奇怪的問題
在 A電腦的IE firefox上瀏覽都正常
但 B電腦firefox卻收不到$_POST的值 IE則正常
程式碼如下
<?php
if (isset($_POST['action']) && $_POST['action'] == 'submitted') {
print '<pre>';
print_r($_POST);
print '<a href="'. $_SERVER['PHP_SELF'] .'">Please try again</a>';
print '</pre>';
} else {
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
Name: <input type="text" name="personal[name]"><br>
Email: <input type="text" name="personal[email]"><br>
Beer: <br>
<select multiple name="beer[]">
<option value="warthog">Warthog
<option value="guinness">Guinness
</select><br>
<input type="hidden" name="action" value="submitted">
<input type="submit" name="submit" value="submit me!">
</form>
<?php
}
?>
在 A電腦IE firefox和 B電腦IE submit之後都會正常print_r出$_POST理的值
但 B電腦firefox submit之後還是出現選單的畫面 似乎是$_POST都收不到值
我有做了一個實驗
把這份程式碼複製兩分 test1.php test2.php
然後test1.php的 action裡面改成test2.php
這樣在B電腦firefox上面就可以正常運作 (test1.php -> test2.php 正常)
再改回test1.php的話就還是不行 (test1.php -> test1.php 失敗)
不知道有沒有人有類似的經驗...
ps 兩台電腦都是XP firefox版本都是3.6.14
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.32.123.33
→
03/04 16:10, , 1F
03/04 16:10, 1F
推
03/10 23:41, , 2F
03/10 23:41, 2F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章