PHP for 循环或数组在一台服务器上工作,但在另一台服务器上不起作用
我有一个脚本,只处理一些复选框并删除选中的复选框。
该脚本无法在我运行 centos 5.5 的个人服务器上运行。当我将脚本从 Hostgator 切换到我的专用服务器后,它无需任何更改就可以正常工作。我不确定它是数组还是循环。当我尝试使用 print_r 打印数组时,它只是说“数组”,
这是表单提交后我所拥有的内容,该表单由名为 delete[] 的复选框列表组成。这几乎是阵列不起作用。
for($i=0;$i<$count;$i++) {
if(!empty($delete[$i])) {
//database query here to delete the date
}
}
I have a script that just processes some checkboxes and deletes the ones that are checked.
The script just wouldnt work on my personal server running centos 5.5. As soon as I swapped the script over to my dedicated server from hostgator, it worked fine without a change. I am not sure if its the array or the loop. When i try to print the array using print_r it just says "Array"
This is what i have after the form submit, the form consists of a list of checkboxes named delete[]. It's almost is the array is not working.
for($i=0;$i<$count;$i++) {
if(!empty($delete[$i])) {
//database query here to delete the date
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种可能性是,您的专用服务器上的“register_globals”已打开。尝试
但出于安全原因您应该检查数组的内容。
One possibility is, that on your dedicated server "register_globals" is on. try
But for security reasons you should check the contents of the array.