表单提交到白页? [英] Form Submits to white page?

查看:98
本文介绍了表单提交到白页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有一个表格用于我的注册系统。当表单提交并出现错误时(如首先输入用户名!或您必须提供密码!),它会成功刷新页面并显示这些错误。



<但是,当表单提交并且用户填写了所有数据,并且没有错误时,表单会进入白页。我查看了源代码,显示的只是页面顶部的javascript,但看起来没有PHP / HTML正在执行。发生了什么?!

- 编辑 -



好的,所以我把错误转移了, '/'>

 注意:使用未定义的常量用户名 - 在/ home / content / 04中使用'username' /7195304/html/header.php on line 54 


解决方案

将此添加到表单脚本的顶部:

  ini_set('display_errors','On'); //有时需要重写时关闭
error_reporting(E_ALL);

因此,您可以查看提交表单时发生的错误。


So I have a form for my register system. When the form submits and there's errors, (like 'Enter a username first!' or 'You must provide a password!') it successfully refreshes the page and shows those errors.

HOWEVER, when the form submits and the user has filled out all of the data, and there is NO errors, the form goes to a white page. I looked in the source, and all that shows is the javascript at the top of my page, but it looks like no PHP/HTML is being executed. What is happening?!

-- EDIT --

Okay, so I turned errors on, and I'm getting stuff like this:

Notice: Use of undefined constant username - assumed 'username' in /home/content/04/7195304/html/header.php on line 54

解决方案

Add this to the top of the form script:

ini_set('display_errors', 'On'); // sometimes it's needed when overridden to Off
error_reporting(E_ALL);

So you can see what the error was when you submitted the form.

这篇关于表单提交到白页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆