ghosh Posted August 17, 2007 Share Posted August 17, 2007 Hello Is there any way to store url into a variable and then use the variable to send the user back to the same page from where he came ??? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/65428-solved-storing-url-value-into-a-variable/ Share on other sites More sharing options...
LiamProductions Posted August 17, 2007 Share Posted August 17, 2007 Basically make a Back button on the page? Quote Link to comment https://forums.phpfreaks.com/topic/65428-solved-storing-url-value-into-a-variable/#findComment-326741 Share on other sites More sharing options...
ghosh Posted August 17, 2007 Author Share Posted August 17, 2007 That is also fine. How do I do that? Quote Link to comment https://forums.phpfreaks.com/topic/65428-solved-storing-url-value-into-a-variable/#findComment-326745 Share on other sites More sharing options...
LiamProductions Posted August 17, 2007 Share Posted August 17, 2007 something like this: <?php $back = $_SERVER['HTTP_REFERER']; <a href="$back">go back</a> ?> Quote Link to comment https://forums.phpfreaks.com/topic/65428-solved-storing-url-value-into-a-variable/#findComment-326748 Share on other sites More sharing options...
ghosh Posted August 17, 2007 Author Share Posted August 17, 2007 Thank you so much.. by the way is there any way I can use php to redirect the page after some time...if the user dont click on the back page. Quote Link to comment https://forums.phpfreaks.com/topic/65428-solved-storing-url-value-into-a-variable/#findComment-326750 Share on other sites More sharing options...
l3asturd Posted August 17, 2007 Share Posted August 17, 2007 here's an example of something I did that sores a URL in a variable. I don't think it's exactly what you're asking though. After rereading your post I realize I didn't get what you meant. lol <?php if (($_POST['answer'])=="Yes"): $link="http://www.domain.com/images/yes.gif"; else: $link="http://www.domain.com/images/no.gif"; endif; echo "Your colorful answer is <IMG SRC=\"".$link."\"></IMG>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/65428-solved-storing-url-value-into-a-variable/#findComment-326751 Share on other sites More sharing options...
LiamProductions Posted August 17, 2007 Share Posted August 17, 2007 Thank you so much.. by the way is there any way I can use php to redirect the page after some time...if the user dont click on the back page. You could use a redirect script Quote Link to comment https://forums.phpfreaks.com/topic/65428-solved-storing-url-value-into-a-variable/#findComment-326756 Share on other sites More sharing options...
ghosh Posted August 17, 2007 Author Share Posted August 17, 2007 here's an example of something I did that sores a URL in a variable. I don't think it's exactly what you're asking though. After rereading your post I realize I didn't get what you meant. lol <?php if (($_POST['answer'])=="Yes"): $link="http://www.domain.com/images/yes.gif"; else: $link="http://www.domain.com/images/no.gif"; endif; echo "Your colorful answer is <IMG SRC=\"".$link."\"></IMG>"; ?> WHat I mean is, I am making a non profit web for public to learn more about the harmful effects of various things of daily life. There is a option to post comments in each page. After posting comment I want to redirect each visitors back to the page from where they came. other wise it will be a cumbersome process for them to search for the same page... when my website grows. so I was asking for some code by which I can send them back to the place from where they came. thanks for taking so much interest to know. Quote Link to comment https://forums.phpfreaks.com/topic/65428-solved-storing-url-value-into-a-variable/#findComment-326766 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.