Jump to content

header() not redirecting.


blackairplane

Recommended Posts

I searched through the forum, but didn't see a solution to this.

 

I tested the if statement using an echo, and that worked fine, so I'm assuming that I did the header statement wrong.

 

$password1= $_REQUEST['password1'];
$password2= $_REQUEST['password2'];

if ($password1 != $password2){
header("Location: http://www.lkaslfdksalkfd.com/register.php?error=1");
}

Link to comment
Share on other sites

You are probably getting a header error because something is being output to the page before the header() statement.

 

Are you developing and debugging php code on a system with error_reporting set to E_ALL and display_errors set to ON in your master php.ini so that php would help you by displaying all the errors it detects? You will save a TON of time.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.