finding location of document

This is a discussion on finding location of document within the PHP General forums, part of the PHP Programming Forums category; Hi there, I am trying to figure this out and can't find the right combination to get what I ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-08-2003
Rogue
 
Posts: n/a
Default finding location of document

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.
Reply With Quote
  #2 (permalink)  
Old 11-08-2003
Rainer Bendig Aka \Mindz\
 
Posts: n/a
Default RE: [PHP] finding location of document

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

So long
Rainer Bendig
crossx.net | wbbreference.de

-----Original Message-----
From: rogue [mailto:rogue@mail.rightcode.net]
Sent: Sunday, November 09, 2003 12:06 AM
To: php-general@lists.php.net
Subject: [php] finding location of document


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
Reply With Quote
  #3 (permalink)  
Old 11-09-2003
Chris Shiflett
 
Posts: n/a
Default Re: [PHP] finding location of document

--- rogue <rogue@mail.rightcode.net> wrote:
> 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/


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
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:40 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0