SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Chepstow, South Wales
    Posts
    907
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Grabbing full url plus after ?

    I am trying ot grab the FULL url but only seem to be able to grab the first bit, everything after ? I cant seem to grab.

    Here is my full path:

    http://www.mysite.co.uk/detail.php?stock_ID=5

    here is what Im getting:

    http://www.mysite.co.uk/detail.php

    and here is my code:

    PHP Code:
    $actual_link "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
    echo 
    $actual_link
    Cheers before hand.

  2. #2
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    71 Post(s)
    Tagged
    0 Thread(s)
    $_SERVER['REQUEST_URI'] SHOULD have the query string attached. It seems that it isnt though.

    $_SERVER['QUERY_STRING'] will contain the rest. (But not the ?. You'll have to insert that yourself)
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.

  3. #3
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Chepstow, South Wales
    Posts
    907
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Right I see, OK have added what I need after the ? and its working great.

    Cheers for getting back to me

  4. #4
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,834
    Mentioned
    73 Post(s)
    Tagged
    6 Thread(s)
    @multichild

    Try this to get the all the other Server settings:

    PHP Code:

    echo '<pre>';
      
    print_r$_SERVER );
    echo 
    '</pre>'
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Patche on earning Member of the Month for July 2014


Bookmarks

Posting Permissions

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