Quick (and easy) PHP question

Discussion in 'PHP' started by holyearth, Feb 6, 2006.

  1. #1
    I know for you guys this should be easy...

    Looked all over and I can't find it :-(

    Here's a PHP script I need (it's easy).....

    User comes to www.abc.com/index.html?keyword=sxtmak

    I need user to go to www.xyz.com/index.html?subid=sxtmak

    Another example....

    User comes to www.xyz.com/index.html?keyword=product245

    I need user to go to www.sas.com/index.html?subid=product245

    I used to have the PHP script to redirect for this kinda thing, but I lost it along with a server crash!!! Could a nice soul whip this up for me?

    Thanks and God bless in advance!!!
     
    holyearth, Feb 6, 2006 IP
  2. holyearth

    holyearth Active Member

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #2
    Got it!!

    <?php

    header("location: http://www.outgoingurl.com?subid=".$_GET['keyword']);
    exit();

    ?>
     
    holyearth, Feb 6, 2006 IP
  3. averagejoe

    averagejoe Peon

    Messages:
    22
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You may want to add

    header("HTTP/1.1 301 Moved Permanently");

    before that.
     
    averagejoe, Feb 7, 2006 IP