Page 1 of 1
undefined variale: PHP_SELF
Posted: Mon Jul 22, 2002 4:17 pm
by Patriot
Notice: Undefined variable: PHP_SELF in c:\apache\htdocs\user\login.php on line 37
this is the error i get every time i try and use $PHP_SELF. but, as i used to think, PHP_SELF doesnt need to be defined manualy.
and when i try and use
if ($submit) {
it says $submit is not set
(
Notice: Undefined variable: submit in c:\apache\htdocs\user\login.php on line 6
)
does this have anything to do with register globals? or is it a php problem after i installed it?
Posted: Mon Jul 22, 2002 4:42 pm
by hob_goblin
yup, open up php.ini, or use $_SERVER['PHP_SELF'] and $_GET, adn $_POST
Posted: Mon Jul 22, 2002 4:46 pm
by Patriot
what would i need to change in php.ini?
Posted: Mon Jul 22, 2002 5:05 pm
by gnu2php
Change
register_globals to
On
In my php.ini file, it's located under this block of text:
;;;;;;;;;;;;;;;;;
; Data Handling ;
;;;;;;;;;;;;;;;;;
Posted: Mon Jul 22, 2002 6:53 pm
by hob_goblin
Some people actually like being secure, and keep it off, though.
It's also a good habit to keep it off. Prevents poor coding.
Posted: Tue Jul 23, 2002 1:45 am
by twigletmac
register_globals has been deprecated, that means that it won't be available for you to turn on in future releases of PHP. So it's probably a good idea to learn how to code without relying on it being on now. It won't make your code more secure but it will make it slightly more difficult for you to write insecure code. You'll also be writing code that's easier for other people to read as it's more obvious where all your variables are coming from.
Please read this thread (where you should've started in the first place):
http://liberty.dnsprotect.com/~devnetwo ... .php?t=511
and check out the manual information on
pre-defined variables
Mac
Posted: Tue Jul 23, 2002 1:59 am
by hob_goblin
i find that you can make more secure scripts with it, especially eliminating use of GET
Posted: Tue Jul 23, 2002 2:21 am
by twigletmac
Even with register_globals off you can still run everything through the $_REQUEST array which since it is an "associative array consisting of the contents of $_GET, $_POST, $_COOKIE, and $_FILES" has the same problems associated with lack of security that register_globals on does. If you know what you're doing it's easy to write 'secure' code register_globals on or off, if you're just getting started having register_globals off will make it more difficult to write 'insecure' code but not impossible.
Mac
Posted: Tue Jul 23, 2002 12:05 pm
by Zmodem
twigletmac wrote:Even with register_globals off you can still run everything through the $_REQUEST array which since it is an "associative array consisting of the contents of $_GET, $_POST, $_COOKIE, and $_FILES" has the same problems associated with lack of security that register_globals on does.
I've noticed this too. I'm glad I'm not the only one