在PHP中使用表单发布方法 [英] using form post method in php
本文介绍了在PHP中使用表单发布方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用表单发布方法传递数组.
Submit.php:
Hi,
I am trying to pass array using form post method.
submit.php :
<form method="post" action="makepub.php">
.... Loop
....
echo ''<table><tbody><tr><td align="center">'';
echo ''<input type="checkbox" name="file_list[]" value="''.$pr.''">'' ;
echo ''</td></tr></tbody></table><table><tbody><tr /></tbody></table>'';
....
.... Loop end
?>
makepub.php:
makepub.php :
if (isset($_POST[''submit1''])) {
$file_list = $_POST["file_list"];
$how_many = count($file_list);
echo ''Total No of Public files chosen : ''.$how_many.''<br><br>'';
if ($how_many>0) {
echo ''You changed following files to public : <br>'';
}
for ($i=0; $i<$how_many; $i++) {
echo ($i+1) . ''- '' . $file_list[$i] . ''<br>'';
// Some code here
}
echo "<br><br>";
}
</br></br></br></br></br></br>
好的,这两个文件在我的XAMPP本地主机上运行完美.
php版本5.3
但在我的服务器阵列上没有通过.
我通过用单个变量替换数组来检查.即使如此,任何内容都不会传递到文件makepub.php
我在这里张贴的文章缺少什么吗?
任何建议表示赞赏.
谢谢.
Ok these two files works perfectly on my localhost with XAMPP.
php version 5.3
but on my server array is not getting passed.
I checked by replacing the array with single variable. Even so nothing is passed to file makepub.php
Is there anything i am missing with post here ???
Any suggestion is appreciated.
Thanks.
推荐答案
pr.''>''; echo``</td></tr>/tbody></table>< tbody< tr/></tbody</table"''; .... ....循环结束 ?>
pr.''">'' ; echo ''</td></tr></tbody></table><table><tbody><tr /></tbody></table>''; .... .... Loop end ?>
makepub.php:
makepub.php :
if (isset(
_POST [''submit1'']))){
_POST[''submit1''])) {
file_list =
file_list =
这篇关于在PHP中使用表单发布方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文