Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default PHP URLs... the string at the end...

    Hey,

    Basically I want to echo the referring site AND the string on the end. For example, http://example.com/?p=1 - whatever I use (HTTP_REFERER) comes back with just http://example.com. REQUEST_URI just brings the current pages ending... so what do I do? It is possibly, maybe it's with javascript though? I know of another site that does it.

    Any help will be appreciated.

  2. #2
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    Code:
    echo $_GET[ 'p' ];
    Hi, names James. I am a web developer.

  3. #3
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default

    Hi,

    You don't understand. Here's my example:

    I am on http://website.com?p=123 and I go to http://website2.com - I want my script on website2 to get the whole of the referring URL.

    If I use HTTP_REFERER it will only get http://website.com and NOT the appending string. I've seen another site doing this, in their control panel, how I don't know (and I doubt they'll tell me).

  4. #4
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    Use a button & post information, I haven't really looked into that.

    Actually, its because you've just gone website.com?p=123, really website.com/?p=123

    eg: heres an example

    http://awesomeness.me.uk/urlgrabber/page_1.php?a=lulz

    Click the link, it will echo the referer and the script on page_2 is just:

    PHP Code:
    <?php echo $_SERVER'HTTP_REFERER' ];
    Hi, names James. I am a web developer.

  5. #5
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default

    Thanks... it seems to send referrer info. with a JS redirect but not with header or a meta refresh.

  6. #6
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    Yes, due to some **** between 301/302 redirections dropping referrer information (I believe, might want some more research into that)

    Your best bet is to pass the information on e.g.: ?referrer=page.com/blah.html
    Hi, names James. I am a web developer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •