chaiwei Posted November 24, 2008 Share Posted November 24, 2008 Hi all, Please kindly look at the following statement. header('Location: '.urlencode($PHP_SELF.'?'.$_SERVER['HTTP_REFERER'])); It doesn't work properly. It show me the page 404 not found. I type 192.168.2.3/chaiwei/main.php it jump to http://192.168.2.3/chaiwei/%3F I want it jump to login page Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/134009-solved-header-location-urlencode/ Share on other sites More sharing options...
mtoynbee Posted November 24, 2008 Share Posted November 24, 2008 What happens when you use $_SERVER['PHP_SELF'] instead? Quote Link to comment https://forums.phpfreaks.com/topic/134009-solved-header-location-urlencode/#findComment-697538 Share on other sites More sharing options...
chaiwei Posted November 24, 2008 Author Share Posted November 24, 2008 i echo out the $_SERVER['HTTP_REFERER']; It shows empty Quote Link to comment https://forums.phpfreaks.com/topic/134009-solved-header-location-urlencode/#findComment-697539 Share on other sites More sharing options...
Mchl Posted November 24, 2008 Share Posted November 24, 2008 HTTP_REFERER is the url of page, from which user got linked to your page. So if you type in your url in browser address bar, it sure is empty. Quote Link to comment https://forums.phpfreaks.com/topic/134009-solved-header-location-urlencode/#findComment-697549 Share on other sites More sharing options...
Adam Posted November 24, 2008 Share Posted November 24, 2008 $_SERVER['HTTP_REFERER'] doesn't always have a value .. ... and mtoynbee is saying $PHP_SELF should be: $_SERVER['PHP_SELF'] Adam Quote Link to comment https://forums.phpfreaks.com/topic/134009-solved-header-location-urlencode/#findComment-697550 Share on other sites More sharing options...
chaiwei Posted November 24, 2008 Author Share Posted November 24, 2008 I see. Thanks a lot. Quote Link to comment https://forums.phpfreaks.com/topic/134009-solved-header-location-urlencode/#findComment-697556 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.