Redirecting to previous page using php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kkonline
Forum Contributor
Posts: 251
Joined: Thu Aug 16, 2007 12:54 am

Redirecting to previous page using php

Post by kkonline »

I want to redirect the user to the previous page, after the processing of the form is successful.

Apart from using meta redirect and java go.back is this possible with php
I don't think i can use header (location mysite/pages.php?a=1&b=2) as it would be a dynamic link .or can i

from current process.php i want to send the user to previous page which is of the format mysite/pages.php?a=1&b=2 (has 2-3 GET parts)
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

the referring URL is often in $_SERVER['HTTP_REFERER'] variable, but it's up to the browser to send it. That being said, it's virtually always there in modern browsers.
Post Reply