Professional Web Applications Themes

finding location of doent - PHP Development

Hi there, I am trying to figure this out and can't find the right combination to get what I want in a certain situation. Suppose I am running a script from an URL like: http://127.0.0.1/~myname/foo/bar.php on this page I want to redirect to another page and send a full http string like: $redirect = "http://" . $_SERVER['HTTP_HOST'] . "/foo/hello.php"; In this case, $_SERVER['HTTP_HOST'] is 127.0.0.1 How can I get the ~/myname/ Thanks rogue BTW. Please copy me directly on any replies as I am on the digest....

  1. #1

    Default finding location of doent

    Hi there,

    I am trying to figure this out and can't find the right combination to
    get what I want in a certain situation.

    Suppose I am running a script from an URL like:

    http://127.0.0.1/~myname/foo/bar.php

    on this page I want to redirect to another page and send a full http
    string like:

    $redirect = "http://" . $_SERVER['HTTP_HOST'] . "/foo/hello.php";

    In this case, $_SERVER['HTTP_HOST'] is 127.0.0.1
    How can I get the ~/myname/

    Thanks
    rogue

    BTW. Please copy me directly on any replies as I am on the digest.
    Rogue Guest

  2. #2

    Default RE: [PHP] finding location of doent

    Have a look on http://us2.php.net/manual/en/function.p-url.php

    So long
    Rainer Bendig
    crossx.net | wbbreference.de

    -----Original Message-----
    From: rogue [mailto:rightcode.net]
    Sent: Sunday, November 09, 2003 12:06 AM
    To: php.net
    Subject: [PHP] finding location of doent


    Hi there,

    I am trying to figure this out and can't find the right combination to
    get what I want in a certain situation.

    Suppose I am running a script from an URL like:

    http://127.0.0.1/~myname/foo/bar.php

    on this page I want to redirect to another page and send a full http
    string like:

    $redirect = "http://" . $_SERVER['HTTP_HOST'] . "/foo/hello.php";

    In this case, $_SERVER['HTTP_HOST'] is 127.0.0.1
    How can I get the ~/myname/

    Thanks
    rogue

    BTW. Please copy me directly on any replies as I am on the digest.

    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php
    Rainer Guest

  3. #3

    Default Re: [PHP] finding location of doent

    --- rogue <rightcode.net> wrote: 

    The complete relative URL requested is avialable to you as:

    $_SERVER["REQUEST_URI"]

    Hope that helps.

    Chris

    =====
    My Blog
    http://shiflett.org/
    HTTP Developer's Handbook
    http://httphandbook.org/
    RAMP Training Courses
    http://www.nyphp.org/ramp
    Chris Guest

Similar Threads

  1. Finding color in doent
    By littlez@adobeforums.com in forum Adobe Indesign Macintosh
    Replies: 6
    Last Post: December 8th, 05:33 AM
  2. Finding a Spot color Location
    By Matthew_Hunter@adobeforums.com in forum Adobe Indesign Windows
    Replies: 4
    Last Post: July 8th, 06:24 PM
  3. finding para styles in a doent
    By Stephen_Field@adobeforums.com in forum Adobe Indesign Windows
    Replies: 1
    Last Post: June 16th, 08:09 PM
  4. what is the equivalent of doent.location in asp.net?
    By Adrian in forum ASP.NET General
    Replies: 1
    Last Post: August 9th, 02:54 AM
  5. how to? doent location replace
    By Thierry Koblentz in forum Macromedia Dreamweaver
    Replies: 0
    Last Post: July 23rd, 03:34 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139