RE: [PHP] register_globals=Off Question

2002-04-28 Thread John Holmes

You are missing an ending quote to begin with. Either add it in and use
braces, or remove the quotes.

action = '?=$_SERVER[PHP_SELF]?'

or...

action = '? echo $_SERVER[PHP_SELF]; ?'

or...

action = '? echo {$_SERVER['PHP_SELF']}; ?'

Adapt to your needs...

---John Holmes...


 -Original Message-
 From: Kirk Babb [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, April 28, 2002 3:58 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] register_globals=Off Question
 
 How do I use $PHP_SELF with register_globals off?  I looked up the
 documentation on php.net but haven't gotten this line of code to work:
 
 form name=form5 method=post action='?php
echo($_SERVER[PHP_SELF];
 ?'
 
 I get this error instead:
 
 [28-Apr-2002 16:33:31] PHP Parse error:  parse error, expecting
`T_STRING'
 or `T_VARIABLE' or `T_NUM_STRING' in - on line 140
 
 what am I doing wrong?  thanks,
 
 Kirk
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



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




Re: [PHP] register_globals=Off Question

2002-04-28 Thread Miguel Cruz

On Sun, 28 Apr 2002, Kirk Babb wrote:
 How do I use $PHP_SELF with register_globals off?  I looked up the
 documentation on php.net but haven't gotten this line of code to work:
 
 form name=form5 method=post action='?php echo($_SERVER[PHP_SELF];
 ?'

action='?= $_SERVER['PHP_SELF'] ?'

miguel


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




Re: [PHP] register_globals=Off Question

2002-04-28 Thread Steve Buehler

Looks like you forgot your ticks ' around the PHP_SELF.  If I am correct, 
it should be $_SERVER['PHP_SELF'].
Either way, you might want to try this.  Somebody else posted it before and 
I have been using it so that no matter what version of PHP my program runs 
on, it should work.
if (isset($_SERVER)) $PHP_SELF = $_SERVER['PHP_SELF'];

Steve

At 05:58 PM 4/28/2002, Kirk Babb wrote:
How do I use $PHP_SELF with register_globals off?  I looked up the
documentation on php.net but haven't gotten this line of code to work:

form name=form5 method=post action='?php echo($_SERVER[PHP_SELF];
?'

I get this error instead:

[28-Apr-2002 16:33:31] PHP Parse error:  parse error, expecting `T_STRING'
or `T_VARIABLE' or `T_NUM_STRING' in - on line 140

what am I doing wrong?  thanks,

Kirk



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


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