Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2003
    Location
    Belgium
    Posts
    23

    Question Unanswered: saving a whole URL in a variable

    Hey,

    I was wondering how you can save a whole URL in a variable.

    please help me, I really need this !!!

    Thanks !!!!!!!!!
    You help me, and I'll try to help you

  2. #2
    Join Date
    May 2003
    Posts
    60
    for your current URL use $PHP_SELF

  3. #3
    Join Date
    Jul 2003
    Location
    New Zealand
    Posts
    9
    To save the url that I am currently I would use this script:
    Code:
    <?php
    $myURL = $PHP_SELF;
    echo $myURL;
    ?>
    PHP self takes the current url.
    Cya!

  4. #4
    Join Date
    Jul 2003
    Posts
    2

    Wink Try This...

    Well to get the full path of your script, try both these predef. variables

    $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] would give you the the complete url.

    On my system, it givs the result as "gallery/self.php" WHERE gallery is the virtualhost and self.php is the file


    To get the fileSystem path, use $_SERVER['PATH_TRANSLATED']

    This gives the result as E:/www/docs/gallery/self.php


    Cheers

Posting Permissions

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