#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    18
    Rep Power
    0
    I've posted this question before, with no success, but now I think I've found a solution. What I'm trying to achieve is to get the actual url in the location bar (as I've stated before, none of the variables in phpinfo() works!), to enable path forwarding.

    I recently saw a script that supposedly only worked for IE, in javascript, using the variable; parent.window.location.pathname; Could this be done in PHP? (or is it client-side only?)

    Here's the script :

    <script language="JavaScript">

    new_path = parent.window.location.pathname;
    if (new_path == "/")
    {
    new_path = new_path + "index2.html";
    }
    if (new_path == "")
    {
    new_path = new_path + "index2.html";
    }

    new_url = host + new_path;

    self.location.href=new_url;
    //-->
    </script>

    Thanks in advance
    Johnny
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    24
    Rep Power
    0
    I'm not very clear on what u are looking for .... do u want the url in the location bar for the page you are viewing or the page u came from

  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    18
    Rep Power
    0
    I want the page in the location bar for the page I'm looking at. It's a typical cloaking thingy, with a frame at the bottom.
    Look here for examples : http://www.metusmortuus.net/
    yields the same result as http://www.metusmortuus.net/somepage.html

    The only way to get the URL would be from the location bar.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    24
    Rep Power
    0
    Try this ....
    <?
    $foo = getenv("HTTP_HOST");
    $bar = getenv("REQUEST_URI");
    echo "http://$foo$bar";
    ?>

    ------------------
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    18
    Rep Power
    0
    Like I said, NONE of the variables in phpinfo() works, which includes http_host, php_self etc. etc. etc...
    Alle these produce the hostname etc. for the server that the actual html-pages resides on, not the virtual server that points to them. (If you look at the source of http://www.metusmortuus.net/ you'll hopefully catch my drift)

Similar Threads

  1. equivalent of database link of Oracle in DB2
    By kollisri in forum DB2 Development
    Replies: 3
    Last Post: August 23rd, 2005, 02:48 PM
  2. Red Hat 8.0 equivalent command
    By photowriters in forum Linux Help
    Replies: 3
    Last Post: December 29th, 2003, 01:35 PM
  3. in_array in php --perl equivalent
    By Viper_SB in forum Perl Programming
    Replies: 1
    Last Post: August 20th, 2003, 09:41 PM
  4. ProcessMessages Equivalent
    By alexpapa in forum HTML Programming
    Replies: 0
    Last Post: July 31st, 2003, 04:43 AM
  5. How can multiple characters be considered equivalent?
    By rhodesiascout in forum MySQL Help
    Replies: 2
    Last Post: September 17th, 2001, 03:12 AM

IMN logo majestic logo threadwatch logo seochat tools logo