-1

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
Seth
  • 2,043
  • 5
  • 20
  • 23
  • What does your `form`'s html look like? Are you sending it to the right script (in the `action` attribute), are the values being processed/found by that script..? – David Thomas Feb 25 '11 at 23:17

4 Answers4

2

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.

MacMac
  • 34,294
  • 55
  • 151
  • 222
  • Notice: Use of undefined constant usernamei - assumed 'usernamei' in /home/content/04/7195304/html/index.php on line 18 Notice: Use of undefined constant passwordi - assumed 'passwordi' in /home/content/04/7195304/html/index.php on line 19 Notice: Use of undefined constant confirm - assumed 'confirm' in /home/content/04/7195304/html/index.php on line 20 Notice: Use of undefined constant email - assumed 'email' in /home/content/04/7195304/html/index.php on line 21 are the errors – Seth Feb 25 '11 at 23:23
  • You must check your HTML, find the `
    – MacMac Feb 25 '11 at 23:34
  • usernamei is not a php variable, it is the name of an HTML input element. And yes, I do have method="POST" – Seth Feb 25 '11 at 23:59
1

An error is occurring partway through the page, and you have error reporting disabled. Enable it and/or check your error log.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
0

This error means that you forget a '$' in front of the variable 'username'.

Hope this help

HulkThor
  • 109
  • 10
0

This is probably because you refer to some data as $_POST[username], instead of $_POST['username'], change that.

Zeta Two
  • 1,776
  • 1
  • 18
  • 37