School Map:
Home / Enroll
$ Student Records; Class
$ News @ LIVE
Tech Radio * Support/FAQ
| Store | FORUMS
Class / Forums / homeroom ![]() |
Undefined variable? |
(#239 2004-04-30 09:07:41) Post Reply |
|
redrum
|
I keep getting an error when using $remote_addr and $http_referer. Any idea why?
phpinfo file opened in web browser: Notice: Undefined variable: REMOTE_ADDR in D:\www\phpinfo\phpinfo.php on line 2 phpinfo file opened in notepad: <?php $ip = $REMOTE_ADDR; echo $ip ?> <?php phpinfo(); ?> |
(#240 2004-05-04 22:53:33) Post Reply |
|
IAmALlama
|
sounds like 'register globals' is set to off.
variables like $_SERVER are superglobals, if 'register globals' is set to on, then php will automatically set a variable like $_SERVER['REMOTE_ADDR'] to $REMOTE_ADDR. if 'register globals' is set to off, then $REMOTE_ADDR won't exist giving you the 'undefined variable' error. in the latter case you would need to get the remote address by using $SERVER['REMOTE_ADDR']. |
|
View Previous Thread Print This Page |
School Map:
Home / Enroll
$ Student Records; Class
$ News @ LIVE
Tech Radio * Support/FAQ
| Store
Advertising
| Link To Us | Privacy
Copyright 2000-2002 Script School Productions / KMR
Enterprises
No part of this website may be reproduced, copied and/or distributed
in any medium
without express written permission