$return_url = $_SERVER['REQUEST_URI'];
header("Location: /logout?msg=You must login to view that page&c=2&path=$return_url");
For some reason its taking me to http://my.domain/login?msg=You%20must%20logi开发者_如何学Pythonn%20to%20view%20that%20page&c=2
when it should take me to
to http://my.domain/login?msg=You%20must%20login%20to%20view%20that%20page&c=2&path=/blogs/write
if i echo $return_url
it returns the right path...
So i'm not sure whats up. Help?
You need to use the urlencode function like so:
header("Location: /logout?msg=".urlencode("You must login to view that page")."&c=2&path=".urlencode($return_url);
In addition, it seems like your logout page is also redirecting to /login. View the sequence of requests which occur using an HTTP Proxy such as Fiddler.
精彩评论