chantown Posted October 10, 2007 Share Posted October 10, 2007 Hi, You know how someone submits a form, and it goes to process_form.php, and after processing, redirects it back to that page? How can I get the URL of my page, and after the person submits the form, take them back? For example: viewtopic.php?topic=32&post=4&id=33 Can I store that portion of my URL (along with all the variables)? (I have heard of $_SESSION['url']) Quote Link to comment https://forums.phpfreaks.com/topic/72565-solved-getting-the-entire-url/ Share on other sites More sharing options...
pocobueno1388 Posted October 10, 2007 Share Posted October 10, 2007 You can store that part of the URL into a session like this $_SESSION['url'] = $_SERVER['REQUEST_URI']; Do that before they post. Then to redirect them, you can do this: header("Location: {$_SESSION['url']}"); Quote Link to comment https://forums.phpfreaks.com/topic/72565-solved-getting-the-entire-url/#findComment-365918 Share on other sites More sharing options...
cooldude832 Posted October 10, 2007 Share Posted October 10, 2007 why extract it that when when you can use GET? Quote Link to comment https://forums.phpfreaks.com/topic/72565-solved-getting-the-entire-url/#findComment-365923 Share on other sites More sharing options...
prime Posted October 10, 2007 Share Posted October 10, 2007 why not just use $lastpage = $_SERVER['HTTP_REFERRER']; and after have the script run simple do a header("location: http://$lastpage"); Quote Link to comment https://forums.phpfreaks.com/topic/72565-solved-getting-the-entire-url/#findComment-365968 Share on other sites More sharing options...
chantown Posted October 11, 2007 Author Share Posted October 11, 2007 ahh thank you poco bueno , perfect Quote Link to comment https://forums.phpfreaks.com/topic/72565-solved-getting-the-entire-url/#findComment-367103 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.