spears47 Posted February 19, 2011 Share Posted February 19, 2011 Hello, I would appreciate if somebody could help me solve my problem I have a form that posts to a php. what i want to do is from that form not get directed to the php but simply grab the url of where it goes. is this possible? for example I hit submit on the form it POSTs to target.php where target.php then sends me to end.php is there a way i can just grab the url from end.php without getting redirected? Quote Link to comment https://forums.phpfreaks.com/topic/228224-php-get-url-from-form/ Share on other sites More sharing options...
cunoodle2 Posted February 19, 2011 Share Posted February 19, 2011 I'm probably going to need to see a little coding example as I'm not 100% sure on what you are looking for. I can tell you that likely you want your form to "post" to one .php page but actually "go" to another?? If that is the case then try php curl to post something "in the background" or combine the pages together via an include statement. Quote Link to comment https://forums.phpfreaks.com/topic/228224-php-get-url-from-form/#findComment-1176913 Share on other sites More sharing options...
spears47 Posted February 19, 2011 Author Share Posted February 19, 2011 Okay thanks. Here is the starting point <html> <form action='login_user.php' method='post'> <input type="hidden" name="action" value="001" /> <input type="hidden" name="serverid" value="" /> USERNAME<input type='text' name='value1' size='20' maxlength='20'/> PASSWORD<input type="password" name="value2" size="20" maxlength="32"/> <input type="submit" value="login" name="login"/> </form> </html> From there it goes to login_user.php with the post. login_user.php then redirects to the account info page What i want is the url from the account info page. is that possible? Quote Link to comment https://forums.phpfreaks.com/topic/228224-php-get-url-from-form/#findComment-1176918 Share on other sites More sharing options...
cunoodle2 Posted February 19, 2011 Share Posted February 19, 2011 From there it goes to login_user.php with the post. login_user.php then redirects to the account info page What i want is the url from the account info page. is that possible? Where exactly do you "want" this url from the account info page and how are you going to use it? Quote Link to comment https://forums.phpfreaks.com/topic/228224-php-get-url-from-form/#findComment-1176920 Share on other sites More sharing options...
spears47 Posted February 19, 2011 Author Share Posted February 19, 2011 i want it as a variable to echo on the starting php Quote Link to comment https://forums.phpfreaks.com/topic/228224-php-get-url-from-form/#findComment-1176925 Share on other sites More sharing options...
cunoodle2 Posted February 19, 2011 Share Posted February 19, 2011 Then just do this.. echo "The Account Info page is: ".$account_info_page.php; Quote Link to comment https://forums.phpfreaks.com/topic/228224-php-get-url-from-form/#findComment-1176939 Share on other sites More sharing options...
spears47 Posted February 20, 2011 Author Share Posted February 20, 2011 this doesn't work. inside the url on the info page is a unique code to each member so you have to login with the form and then i want the url with the code Quote Link to comment https://forums.phpfreaks.com/topic/228224-php-get-url-from-form/#findComment-1177006 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.