Re: [PHP-DB] Current web page being displayed

2005-08-07 Thread Matthew Weier O'Phinney
* RaJeSh VeNkAtA <[EMAIL PROTECTED]> :
>
> hai ..
>   if u r seeing http://www.google.com/blog/myblog.php
>
> then
>   $_SERVER[SERVER_NAME] would give u www.google.com
> and
>   $_SERVER[PHP_SELF] would give u /blog/myblog.php

PHP_SELF also gives the PATH_INFO and QUERY_STRING of the script, which
can make it problematic to determine the exact script name:

http://www.example.com/path/to/script.php/extra/path/info?id=7

would give

/path/to/script.php/extra/path/info?id=7

for PHP_SELF, when in liklihood you're looking for

/path/to/script.php

If using Apache, use SCRIPT_NAME as the $_SERVER key -- this gives just
the path to the script - no PATH INFO, no QUERY_STRING. 

There are some regexps/functions floating around out there to remove
PATH_INFO and QUERY_STRING from PHP_SELF as well, and this may be more
portable than SCRIPT_NAME as not all httpd servers use it.

> On Sat, 6 Aug 2005, Ron Piggott wrote:
>
> > What is the correct $_SERVER that tells me what page is currently being
> > displayed?  Ron

-- 
Matthew Weier O'Phinney
Zend Certified Engineer
http://weierophinney.net/matthew/

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



Re: [PHP-DB] Current web page being displayed

2005-08-06 Thread Shahmat Dahlan

Or you can do the one show below

M Saleh EG wrote:


lol...
print_r($_SERVER); would be enough to show you all the server array tags.

 
On 8/7/05, *Shahmat Dahlan* <[EMAIL PROTECTED] 
> wrote:


You can try
foreach ($_SERVER as $key => $value)
   echo "$key => $value";

or you can check out them out in when calling phpinfo ();

RaJeSh VeNkAtA wrote:

>
> hai ..
> if u r seeing http://www.google.com/blog/myblog.php
>
> then
> $_SERVER[SERVER_NAME] would give u www.google.com

> and
> $_SERVER[PHP_SELF] would give u /blog/myblog.php
>
> for details just print the array $_SERVER and see it ..
>
>
>
> On Sat, 6 Aug 2005, Ron Piggott wrote:
>
>> What is the correct $_SERVER that tells me what page is
currently being
>> displayed?  Ron
>>
>>
>




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




--
M.Saleh.E.G
97150-4779817 




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

Re: [PHP-DB] Current web page being displayed

2005-08-06 Thread Shahmat Dahlan

You can try
foreach ($_SERVER as $key => $value)
   echo "$key => $value";

or you can check out them out in when calling phpinfo ();

RaJeSh VeNkAtA wrote:



hai ..
if u r seeing http://www.google.com/blog/myblog.php

then
$_SERVER[SERVER_NAME] would give u www.google.com
and
$_SERVER[PHP_SELF] would give u /blog/myblog.php

for details just print the array $_SERVER and see it ..



On Sat, 6 Aug 2005, Ron Piggott wrote:


What is the correct $_SERVER that tells me what page is currently being
displayed?  Ron







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

Re: [PHP-DB] Current web page being displayed

2005-08-06 Thread RaJeSh VeNkAtA


hai ..
if u r seeing http://www.google.com/blog/myblog.php

then
$_SERVER[SERVER_NAME] would give u www.google.com
and
$_SERVER[PHP_SELF] would give u /blog/myblog.php

for details just print the array $_SERVER and see it ..



On Sat, 6 Aug 2005, Ron Piggott wrote:


What is the correct $_SERVER that tells me what page is currently being
displayed?  Ron




--
*

You wouldn't know an OS if it hit you in the face ...

Linux Baby !

*

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



Re: [PHP-DB] Current web page being displayed

2005-08-06 Thread Webmaster

Ron Piggott wrote:


What is the correct $_SERVER that tells me what page is currently being
displayed?  Ron

 


http://www.php.net/reserved.variables

Never used it, but I'm going to guess script_filename or script_name ?

HTH,
Roger

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