#1
  1. No Profile Picture
    DanH
    Guest
    Devshed Newbie (0 - 499 posts)
    Hello. I'm looking for PHP equivalent to Javascript's location.href property. This returns the ENTIRE url (including any variables that might be submitted to a script). I've looked at phpinfo(), but I didn't see exactly what I am after. If the answer is the HTTP_POST_VARS variable, could someone please give me a simple example of how exactly this variable is to be used in code?

    Thanks for your time.
    Dan
  2. #2
  3. No Profile Picture
    moderator
    Guest
    Devshed Newbie (0 - 499 posts)
    The following code will get the path and everything after the domain name.

    ie if the page name is http://www.devshed.com/index.html?bleh=bleh

    the following code will echo out "/index.html?bleh=bleh"

    <?
    echo $PHP_SELF."?".$QUERY_STRING;
    ?>
  4. #3
  5. No Profile Picture
    DanH
    Guest
    Devshed Newbie (0 - 499 posts)
    Ah, perfect. Thanks alot.

    Dan

Similar Threads

  1. help with an isGreater function
    By qiushiming in forum C Programming
    Replies: 18
    Last Post: February 5th, 2004, 08:23 AM
  2. Change ip url to domain
    By crypt1c_c0d3 in forum Apache Development
    Replies: 2
    Last Post: January 2nd, 2004, 09:55 AM
  3. Odd problem with a hash and foreach loop
    By quantumechanix in forum Perl Programming
    Replies: 7
    Last Post: December 15th, 2003, 05:06 PM
  4. Applet Crashes
    By tony825 in forum Java Help
    Replies: 1
    Last Post: December 15th, 2003, 06:24 AM

IMN logo majestic logo threadwatch logo seochat tools logo