Jump to content

Sending the page URL to another page


Mark H
 Share

Recommended Posts

I am not fully versant with PHP...especially the functions.Should I be looking at the various functions in order to send the referring URL to another page, in order that the target page may then refer the user back to the original page? Much like this forum does when you sign in.Would this be the right approach, or would a browser script such as javascript be better?Mark.

Link to comment
Share on other sites

you can use $_SERVER['HTTP_REFERER'] to get the refer URLand the header("location:somepage.php") to redirect. http://php.net/function.headerjavascript can be blocked by user i think doing it with php is more reliable and effective.

Link to comment
Share on other sites

Thank you.I have had a look at the php link you gave...I'm unsure how I can create a "pause" before the redirect. Will this be simply another function?I keep going through the PHP tutorial, but my forgetfulness........I can't remember if it is possible to pause the execution of a function.What I require is for the page to load, then pause, then after, say 5 seconds, redirect to the referring page.Thanks, :)

Link to comment
Share on other sites

you can use meta tag to redirect orheader("refresh:5;url=http://mysite.com);refresh represents the time delay in seconds

Edited by birbal
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...