[PHP] where is PHP_SELF?

2002-01-31 Thread Erik Price

I have a file called index.php.  This file includes another file, 
foot.inc.  In the file foot.inc, amidst much HTML code, I have a 
simple line:

?php
echo p$PHP_SELF/p ;
?

The expected result is that pindex.php/p will appear in my web 
page, or at least something will appear.  Yet, when the page is served 
to my browser, all that shows up is the p/p.  The variable 
$PHP_SELF isn't getting through.  Am I doing something wrong, or is this 
because that variable is assigned to the name foot.inc, and has been 
included into another file?  Does the name of the page served not get 
passed onto the include file, where $PHP_SELF is echoed?

Thanks for any insight you can give,

Erik

PS: I have an Apache directive that prevents any *.inc files from 
being served, but that doesn't stop them from being parsed as PHP.  I'm 
running PHP 4.1.0 on LAMP w/register_globals=off







Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] where is PHP_SELF?

2002-01-31 Thread Lars Torben Wilson

On Thu, 2002-01-31 at 14:57, Erik Price wrote:
 I have a file called index.php.  This file includes another file, 
 foot.inc.  In the file foot.inc, amidst much HTML code, I have a 
 simple line:
 
 ?php
 echo p$PHP_SELF/p ;
 ?
 
 The expected result is that pindex.php/p will appear in my web 
 page, or at least something will appear.  Yet, when the page is served 
 to my browser, all that shows up is the p/p.  The variable 
 $PHP_SELF isn't getting through.  Am I doing something wrong, or is this 
 because that variable is assigned to the name foot.inc, and has been 
 included into another file?  Does the name of the page served not get 
 passed onto the include file, where $PHP_SELF is echoed?
 
 Thanks for any insight you can give,
 
 Erik
 
 PS: I have an Apache directive that prevents any *.inc files from 
 being served, but that doesn't stop them from being parsed as PHP.  I'm 
 running PHP 4.1.0 on LAMP w/register_globals=off
  

Since register_globals is off, the $_SERVER array will not be extracted
into the global scope. Try $_SERVER['PHP_SELF'] and you should be fine.


Hope this helps,

Torben

 
 
 Erik Price
 Web Developer Temp
 Media Lab, H.H. Brown
 [EMAIL PROTECTED]

-- 
 Torben Wilson [EMAIL PROTECTED]
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] where is PHP_SELF?

2002-01-31 Thread Chris Randall

I too just had this problem, it seems that this happens when php is installed as a cgi 
binary with 
apache, perhaps if you use $_SERVER[PATH_INFO)  or perhaps 
$_SERVER[SCRIPT_NAME] or even $path_info, just some ideas, i've not tested this at 
all yet... 
good luck

1/31/02 2:57:55 PM, Erik Price [EMAIL PROTECTED] wrote:

I have a file called index.php.  This file includes another file, 
foot.inc.  In the file foot.inc, amidst much HTML code, I have a 
simple line:

?php
echo p$PHP_SELF/p ;
?

The expected result is that pindex.php/p will appear in my web 
page, or at least something will appear.  Yet, when the page is served 
to my browser, all that shows up is the p/p.  The variable 
$PHP_SELF isn't getting through.  Am I doing something wrong, or is this 
because that variable is assigned to the name foot.inc, and has been 
included into another file?  Does the name of the page served not get 
passed onto the include file, where $PHP_SELF is echoed?

Thanks for any insight you can give,

Erik

PS: I have an Apache directive that prevents any *.inc files from 
being served, but that doesn't stop them from being parsed as PHP.  I'm 
running PHP 4.1.0 on LAMP w/register_globals=off







Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] where is PHP_SELF?

2002-01-31 Thread Erik Price


On Thursday, January 31, 2002, at 06:12  PM, Lars Torben Wilson wrote:

 On Thu, 2002-01-31 at 14:57, Erik Price wrote:

  I'm running PHP 4.1.0 on LAMP w/register_globals=off
   

 Since register_globals is off, the $_SERVER array will not be extracted
 into the global scope. Try $_SERVER['PHP_SELF'] and you should be fine.


AHHH...  I didn't know that the predefined variables belonged to an 
array like that.  So far I haven't used anything but $_GET, $_POST, and 
$_SESSION.  Guess I should study some more.

Thanks Lars

Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]