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
Share on other sites

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
Link to comment
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.