blackairplane Posted March 10, 2010 Share Posted March 10, 2010 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"); } Quote Link to comment https://forums.phpfreaks.com/topic/194780-header-not-redirecting/ Share on other sites More sharing options...
PFMaBiSmAd Posted March 10, 2010 Share Posted March 10, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/194780-header-not-redirecting/#findComment-1024244 Share on other sites More sharing options...
blackairplane Posted March 10, 2010 Author Share Posted March 10, 2010 Ok, so it seems that one of my include() scripts was messing it up like you said. Thanks for the help, and unfortunately I am using a hosting service so I can't change the ini file. Quote Link to comment https://forums.phpfreaks.com/topic/194780-header-not-redirecting/#findComment-1024250 Share on other sites More sharing options...
PFMaBiSmAd Posted March 10, 2010 Share Posted March 10, 2010 You should be developing and debugging code on a local development system. You will save a TON of time. Constantly uploading code to test it during the development and debugging cycle wastes a lot of time. Quote Link to comment https://forums.phpfreaks.com/topic/194780-header-not-redirecting/#findComment-1024253 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.