Boo-urns Posted July 4, 2008 Share Posted July 4, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/113202-solved-headerampquotlocation-ampquot-problems/ Share on other sites More sharing options...
Wolphie Posted July 4, 2008 Share Posted July 4, 2008 Could you please provide the code relevant to the question and the desired result? Without it, we can't help you. Quote Link to comment https://forums.phpfreaks.com/topic/113202-solved-headerampquotlocation-ampquot-problems/#findComment-581597 Share on other sites More sharing options...
Boo-urns Posted July 4, 2008 Author Share Posted July 4, 2008 I can't give the exact path but here is the gist of the header header("Location: http://subdomain.domain.com/test-sites/register.php?success=true"); Quote Link to comment https://forums.phpfreaks.com/topic/113202-solved-headerampquotlocation-ampquot-problems/#findComment-581599 Share on other sites More sharing options...
mmarif4u Posted July 4, 2008 Share Posted July 4, 2008 Sorry Boo-urns,your code will not help any one here to help u.bcoz its like gasturing in the dark. Please provide your full code,otherwise the above header line which you provide is correct. Quote Link to comment https://forums.phpfreaks.com/topic/113202-solved-headerampquotlocation-ampquot-problems/#findComment-581602 Share on other sites More sharing options...
Boo-urns Posted July 4, 2008 Author Share Posted July 4, 2008 Alright well thanks for the info about the header line being correct. As, I commented out the whole form submission and it still had the delay. Could it be a server issue? Quote Link to comment https://forums.phpfreaks.com/topic/113202-solved-headerampquotlocation-ampquot-problems/#findComment-581722 Share on other sites More sharing options...
Boo-urns Posted July 4, 2008 Author Share Posted July 4, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/113202-solved-headerampquotlocation-ampquot-problems/#findComment-581774 Share on other sites More sharing options...
Boo-urns Posted July 4, 2008 Author Share Posted July 4, 2008 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" /> Quote Link to comment https://forums.phpfreaks.com/topic/113202-solved-headerampquotlocation-ampquot-problems/#findComment-581821 Share on other sites More sharing options...
compguru910 Posted July 4, 2008 Share Posted July 4, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/113202-solved-headerampquotlocation-ampquot-problems/#findComment-581825 Share on other sites More sharing options...
Boo-urns Posted July 4, 2008 Author Share Posted July 4, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/113202-solved-headerampquotlocation-ampquot-problems/#findComment-581834 Share on other sites More sharing options...
Boo-urns Posted July 5, 2008 Author Share Posted July 5, 2008 Apache needed to be restarted even though I just transferred everything, and that fixed the problem. Ugh what a headache, thanks for your help! Quote Link to comment https://forums.phpfreaks.com/topic/113202-solved-headerampquotlocation-ampquot-problems/#findComment-582506 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.