faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

15 of 19 people (79%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

I can't use the $REMOTE_ADDR variable: it just shows a 0. But in <?phpinfo();?> it shows up properly

Mar 15th, 2008 18:03
ha mo, Articles Hosting, Philip Olson, markus dinter, Guest,


The PHP directive register_globals must be ON for web server 
predefined 
variables, such as $REMOVE_ADDR, to even exist.  Regardless of it 
being 
on or off you can go through the PHP predefined variables instead:
  print $HTTP_SERVER_VARS['REMOTE_ADDR'];
  print $_SERVER['REMOTE_ADDR']; (avail as of 4.1.0)
For related information, see the related fact on HTTP_REFERER.
  http://www.faqts.com/knowledge_base/view.phtml/aid/31
=====
phpfreaks.com/phpref/52.php
i hope that helps:
http://americanahost.com
http://www.qwesz.com
http://www.tantofa.com
http://www.fantofa.com
http://www.mantofa.com
http://www.tanpola.com
http://www.tampola.com
http://www.mozmar.com
http://www.yamot.com
http://www.templatestemp.com