The_Thorn Posted December 30, 2013 Share Posted December 30, 2013 I have been researching this, with varying results. This is just a test at this point: User enters data in form > Submits to DB Page refreshes to new, different page I am using the following in my file: header('Location:/ newPage.php '); When I test this, the page IS redirected, but not to the correct page as coded. It loads a default, company-server advertisement page, stating it could not locate the requested URL/file. This file, newPage.php, lives on the server. Any ideas? Is my syntax incorrect? Thank you in advance. The_Thorn Quote Link to comment https://forums.phpfreaks.com/topic/284976-url-redirect/ Share on other sites More sharing options...
ginerjm Posted December 30, 2013 Share Posted December 30, 2013 You have a space between your slash and your url name. Specify the url correctly and perhaps it will work. Quote Link to comment https://forums.phpfreaks.com/topic/284976-url-redirect/#findComment-1463290 Share on other sites More sharing options...
The_Thorn Posted December 30, 2013 Author Share Posted December 30, 2013 You have a space between your slash and your url name. Specify the url correctly and perhaps it will work. Thank you for pointing those errors out. I appreciate it. I fixed that. But, when running it, I now get This webpage has a redirect loop - I'm not even sure what that means, exactly - I am only redirecting once. Quote Link to comment https://forums.phpfreaks.com/topic/284976-url-redirect/#findComment-1463291 Share on other sites More sharing options...
mac_gyver Posted December 30, 2013 Share Posted December 30, 2013 the page you are redirecting to is likely redirecting back to the first page or it's all the same page. this indicates two possible problems - 1) you have a logic error. i.e. your program logic shouldn't be redirecting under some conditions and the conditions you are testing are incorrect or don't exist at all. 2) you need to have an exit; statement after header() redirects to prevent the rest of the code on the page from running. Quote Link to comment https://forums.phpfreaks.com/topic/284976-url-redirect/#findComment-1463296 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.