Home  >  Article  >  Backend Development  >  form提交数据的页面处理有关问题

form提交数据的页面处理有关问题

WBOY
WBOYOriginal
2016-06-13 10:16:251001browse

form提交数据的页面处理问题
表单数据的提交处理

newUser.php是主页面的框架下的一个子页面,其中提交表单时用到了页面adduser.php



而adduser.php又用到了func.php中的函数
include "func.php";
//include "./func.php";
这两种写法都会造成执行操作失败:
HTTP 错误 500.0 - Internal Server Error

即使把引用func.php中函数的语句全部屏蔽,只保留这一句include也一样会出错。
但只要把这句屏蔽,然后执行其它操作,就成功了......
说明肯定是这一句的问题。

求解决办法。

相关的文件路径结构如下:

主目录:test/
pubmain.php
newUser.php
conn/adduser.php
conn/func.php

是不是我设置的问题呢?

------解决方案--------------------
看着adduser.php和func.php都在同一目录,不应该出错。
但是你并没有开启错误提示,所以不能否定其它方面没问题。例如func.php语法上有错误导致致命错误。
所以,修改php.ini display_errors = On 重启服务器,看看错误提示再说
------解决方案--------------------
我倒。。。
我刚才已经说了,最后一句话。
或者你可以在代码前面加上一句代码: error_reporting( E_ALL | E_NOTICE );
------解决方案--------------------
探讨

引用:

看着adduser.php和func.php都在同一目录,不应该出错。
但是你并没有开启错误提示,所以不能否定其它方面没问题。例如func.php语法上有错误导致致命错误。
所以,修改php.ini display_errors = On 重启服务器,看看错误提示再说

谢谢回复,怎么开启错误提示呀?

------解决方案--------------------
在PHP中包含文件最好:
include (dirname(__FILE__) . "/initialize.php");
include (dirname(__FILE__) . "/../mode/mysql_mode_class.php");
因为在php中的包含是以当前执行页面为基层的。
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn