Try $_SERVER['PHP_SELF']

If you don't have 'register_globals = on' setting in your php.ini file
then you must reference these special server variables in this way.

It's generally a good idea to leave 'register_globals = off' and
identify the global variables either by $_SERVER['varname'] or
$_POST['varname'] etc. because the other way can be a security risk.



-----Original Message-----
From: Adam Dear [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 29, 2003 9:49 PM
To: php-install
Subject: [PHP-INSTALL] $PHP_SELF

I have just installed php.  I am new to php.  I have read several
items(ie.
books, online documentation).  I have seen references to a variable
called
$PHP_SELF.  I have tried to use it in a form, but to no avail.

Here is a line of code where I have used it:
  <form action=<?php echo $PHP_SELF ?>?form=yes method="post">

However, when I view the souce of this page, the "action" attribute is
simply:
                        <form action=?form=yes .....
The $PHP_SELF variable is not referencing anything.  Is there something
that
I have not configured properly?

Please help a newbie.

Thanks

Reply via email to