BobBlightman Posted June 29, 2022 Share Posted June 29, 2022 Here's the code echo "calling www.rowledgecricketclub.com"; header("Location:www.rowledgecricketclub.com"); I get the echo, but the new page doesn't open - it stays with a blank screen showing the current address at the top Why doesn't the new page open? Many thanks Quote Link to comment https://forums.phpfreaks.com/topic/314974-my-php-code-which-has-worked-for-years-now-doesnt/ Share on other sites More sharing options...
BobBlightman Posted June 29, 2022 Author Share Posted June 29, 2022 I only put the echo in to check it was getting to this point (if I delete the echo, it still doesn't work) Quote Link to comment https://forums.phpfreaks.com/topic/314974-my-php-code-which-has-worked-for-years-now-doesnt/#findComment-1597712 Share on other sites More sharing options...
ginerjm Posted June 29, 2022 Share Posted June 29, 2022 (edited) Can you view the contents of the screen and see if anything is there? Or put an echo in the start of the called script to see if it even opens up? Edited June 29, 2022 by ginerjm Quote Link to comment https://forums.phpfreaks.com/topic/314974-my-php-code-which-has-worked-for-years-now-doesnt/#findComment-1597713 Share on other sites More sharing options...
cyberRobot Posted June 29, 2022 Share Posted June 29, 2022 Did you try using the complete address, including the protocol? header("Location: http://www.rowledgecricketclub.com/"); Have you tried enabling all PHP errors/warnings? This would go at near the top of your PHP script, within the PHP tags. //REPORT ALL PHP ERRORS error_reporting(E_ALL); ini_set('display_errors', 1); Be sure to remove the above debugging code when you're done testing. Quote Link to comment https://forums.phpfreaks.com/topic/314974-my-php-code-which-has-worked-for-years-now-doesnt/#findComment-1597714 Share on other sites More sharing options...
ginerjm Posted June 29, 2022 Share Posted June 29, 2022 It appears that you have made a change to your code which is causing it to fail. You did not mention that - you said it has worked for years. I did as CyberRobot suggested and it works fine for me. Although one cannot do an echo before calling a header. Quote Link to comment https://forums.phpfreaks.com/topic/314974-my-php-code-which-has-worked-for-years-now-doesnt/#findComment-1597719 Share on other sites More sharing options...
mac_gyver Posted June 29, 2022 Share Posted June 29, 2022 1 minute ago, ginerjm said: you said it has worked for years. php installation was probably updated and turned off the output_buffering php.ini setting, resulting in previously working bad code to stop working. Quote Link to comment https://forums.phpfreaks.com/topic/314974-my-php-code-which-has-worked-for-years-now-doesnt/#findComment-1597721 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.