Hello,
I want to know how can I set exact URL such as:
http://www.mydomain.com/home/control...?varId=123_abc
I wish to use it then for the redirection purposes.
Please note: $_SERVER['HTTP_REFERER'] will not work.
Awaiting a response.
Thanks.
| SitePoint Sponsor |
Hello,
I want to know how can I set exact URL such as:
http://www.mydomain.com/home/control...?varId=123_abc
I wish to use it then for the redirection purposes.
Please note: $_SERVER['HTTP_REFERER'] will not work.
Awaiting a response.
Thanks.




URL of what?
Pawel Decowski (you should follow me on Twitter)
http://www.mydomain.com/home/control...?varId=123_abc << this one
I tried. but not been able to fetch Query string.




I still don’t understand. Where does the URL come from? Or where is it supposed to come from?
Pawel Decowski (you should follow me on Twitter)

Are you referring to setting it up in the .htaccess file for a 301 redirect or doing some sort of mod rewrite?
See..
my site has user restricted area:
1. View orders
user tried to view his/her order but he/she not loggen in so php script will redirects to login.
at login page, I want to save a URL from where user came to login.php
hope its clear to you now ?? Please confirm




And then, upon succesfull login:PHP Code:header('Location: /login.php?goto=' . urlencode($_SERVER['REQUEST_URI']));
Of course you may want to verify the $_GET['goto'] value.PHP Code:header('Location: ' . $_GET['goto']);
Pawel Decowski (you should follow me on Twitter)




Something’s not right then because REQUEST_URIincludesshould include the query string. Post some code.
Pawel Decowski (you should follow me on Twitter)





Try putting print_r($_SERVER); into the page and see what comes up![]()
Bookmarks