Do the following referral links work the same?

Discussion in 'PHP' started by wuken, Feb 14, 2010.

  1. #1
    Say my site referral link is: domain.com/index.php?10

    Are the following variations also functional?
    1. domain.com/?10
    2. domain.com?10

    Thanks in advance.
     
    wuken, Feb 14, 2010 IP
  2. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #2
    1 should work yes, not sure about 2.

    But if they don't work how you'd like them too, then it can be achieved using mod_rewrite.
     
    danx10, Feb 14, 2010 IP
  3. Will Bontrager

    Will Bontrager Peon

    Messages:
    14
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    All three examples put "10" into $_SERVER['QUERY_STRING']

    If the referral information is obtained from the query string, all examples should work. If some other method, the variations might not work.

    Will
     
    Will Bontrager, Feb 14, 2010 IP
  4. krsix

    krsix Peon

    Messages:
    435
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    2 should probably never work but browsers do it just to 'autocomplete'/'adapt' iirc
     
    krsix, Feb 14, 2010 IP
  5. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #5
    As Will suggested, you can experiment.

    Add the following to index.php:

    <?php
    echo $_SERVER['QUERY_STRING']; 
    ?>
    
    PHP:
    It will proove if they work.
     
    danx10, Feb 16, 2010 IP