看看这段代码:为什么zzz.html中的hidden提交不到form123.php中(PHP设置没问题(其他的都行))???

itbook 2002-11-30 11:21:10
为什么zzz.html中的hidden提交不到form123.php中(PHP设置没问题(其他的都行))???
文件:zzz.html
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<form name=form1 method=post action='form123.php'>
<script>
var abc = new Array();
document.write("<input type='hidden' name=abc[] value='aa'>");
document.write("<input type='hidden' name=abc[] value='bb'>");
document.write("<input type='hidden' name=abc[] value='cc'>");
</script>
<input type=submit value=提交>
</form>
</BODY>
</HTML>

文件:form123.php
<?php
print'<pre>';
print_r($abc);
print'</pre>';
?>
...全文
63 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
hjbwt 2002-11-30
  • 打赏
  • 举报
回复
用hidden数组传递字符串根本就不行,因为在php中字符串本来就是数组,所以不能用数组传递字符串,想想用其他办法吧!关注!
全息宇宙 2002-11-30
  • 打赏
  • 举报
回复
为什么zzz.html中的hidden提交不到form123.php中(PHP设置没问题(其他的都行))???
如果代码不行请提出解决方法,谢了先.
文件:zzz.html
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<form name=form1 method=post action='form123.php'>
<script>
var abc = new Array();
document.write("<input type='hidden' name=abc[] value='aa'>");
document.write("<input type='hidden' name=abc[] value='bb'>");
document.write("<input type='hidden' name=abc[] value='cc'>");
</script>
<input type=submit value=提交>
</form>
</BODY>
</HTML>

文件:form123.php
<?php
print'<pre>';
print_r($abc);
print'</pre>';
?>

87,997

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧