Jump to content

[SOLVED] header("Location: ") problems


Boo-urns

Recommended Posts

I just moved my test site to a subdomain, and now the header redirect is not working.  I changed it from relative to absolute path and it is only working some of the time, otherwise it will take roughly 122 seconds in FF3 to do the redirect.  I did check out all of my form post / database submission and it turned out just to be the header redirect.  Has anyone experienced this and any suggestions? Thanks

The problem was I had a

 

<?php
if($error != 1) {
    header("Location: next.php");
}
?>

But i never initialized the value, only if there was an error, never had that problem before but now I must initialize it. Hope this helps someone with this problem.

Hmm...that wasn't the problem.I took out all programming except for:

 

<?php
if(isset($_POST['submitForm'])){

	//redirect to this page but w/ submitted
	header("Location: http://subdomain.domain.com/test-sites/register.php?success=true");

}//end of submit
?>

 

Corresponding button =

<input type="submit" name="submitForm" id="submitbutton" value="Submit" />

That code should have worked. I tested on my server and it worked fine. I believe this to either be a server issue, or a php.ini error. I believe there to be a setting in there that allows for redirection with PHP. Are you renting a server/domain, or is this on your own machine. And what version of PHP are you running?

Yea I know it should work which is weird it has to be something with the file I'm guessing. I did try a redirect with PHP on another page and it worked fine, not sure why this would be held up.

 

Yea renting a server and domain.

PHP is 5.2.6

 

Could some javascript be getting in the way?

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.