Jump to content

PHP redirect Help


davidlenehan

Recommended Posts

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 you
DAvid.
Link to comment
https://forums.phpfreaks.com/topic/4597-php-redirect-help/
Share on other sites

[!--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 redirect

Ray
[/quote]

cheers ray!
Link to comment
https://forums.phpfreaks.com/topic/4597-php-redirect-help/#findComment-16160
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.