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
https://forums.phpfreaks.com/topic/194780-header-not-redirecting/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.