davidlenehan Posted March 10, 2006 Share Posted March 10, 2006 Hi,I have a quick query, Im new to PHP, I was wondering if someone could help me with this problem. I need to place some PHP in the head include file on my website. And I need to to check the following:If the current page url is:[a href=\"http://www.rrr.com/news/130/\" target=\"_blank\"]http://www.rrr.com/news/130/[/a]then redirect to:[a href=\"http://www.rrr.com/sss.php\" target=\"_blank\"]http://www.rrr.com/sss.php[/a]How can I check the url?thank youDAvid. Link to comment https://forums.phpfreaks.com/topic/4597-php-redirect-help/ Share on other sites More sharing options...
craygo Posted March 10, 2006 Share Posted March 10, 2006 Well you can put togetter a couple variables to find out where you are at[code]$site = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'';[/code]That will give you the address you are currently at. Then use an if then statement to redirectRay Link to comment https://forums.phpfreaks.com/topic/4597-php-redirect-help/#findComment-16159 Share on other sites More sharing options...
davidlenehan Posted March 10, 2006 Author Share Posted March 10, 2006 [!--quoteo(post=353652:date=Mar 10 2006, 04:37 PM:name=craygo)--][div class=\'quotetop\']QUOTE(craygo @ Mar 10 2006, 04:37 PM) [snapback]353652[/snapback][/div][div class=\'quotemain\'][!--quotec--]Well you can put togetter a couple variables to find out where you are at[code]$site = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'';[/code]That will give you the address you are currently at. Then use an if then statement to redirectRay[/quote]cheers ray! Link to comment https://forums.phpfreaks.com/topic/4597-php-redirect-help/#findComment-16160 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.