XILO Community Forum

Support 03333 407 407 • Sales 0800 084 2421 • sales chat

  (#1 (permalink)) Old
Reseller
travellinglad is on a distinguished road
 
Posts: 81
Join Date: Dec 2005
Default Showing IP issue - 07/07/2007, 8:09 AM

Code:
 
<?php echo $REMOTE_ADDR; ?> 
I have this in a PHP file, but the IP address isn't showing.

It was until a few months back.

Anyone have any idea why?
Reply With Quote
  (#2 (permalink)) Old
User
solaris is on a distinguished road
 
Posts: 36
Join Date: Jul 2006
Default Re: Showing IP issue - 07/07/2007, 8:57 AM

Hi,

This will be because you have register_globals turned off (as it should be). You can access the same variable with:

PHP Code:
$_SERVER['REMOTE_ADDR'
I know that some time back the Xilo shared hosting default was for register_globals on - and I had raised the issue with Matt then. It could be that it has since been turned off, hence the change you noticed. You should update your code to reflect the change, as register_globals really should be off for security reasons.

Hope that helps

Last edited by solaris; 07/07/2007 at 9:01 AM..
Reply With Quote
  (#3 (permalink)) Old
Reseller
travellinglad is on a distinguished road
 
Posts: 81
Join Date: Dec 2005
Default Re: Showing IP issue - 07/07/2007, 9:02 AM

Ah that explains it Samir - thanks.

Do I just add that snippet of code as it is or do I need to include it into < ? php tag. Sorry, I'm not good on PHP, but learning.
Reply With Quote
  (#4 (permalink)) Old
Techie & Moderator
Kieran is on a distinguished road
 
Kieran's Avatar
 
Posts: 753
Join Date: Apr 2006
Location: Swindon, UK
Default Re: Showing IP issue - 07/07/2007, 4:46 PM

Your code would need to be the following to echo the visitors IP address (remove space between the < and the ? )

Code:
< ?
echo $_SERVER['REMOTE_ADDR'];
?>
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue with Reseller Jessica Support Queries 0 28/09/2007 4:59 PM
E-mail Issue Simon Support Queries 6 06/09/2007 10:17 AM
DNS issue? WEBDosser Support Queries 3 22/05/2007 1:43 PM


Powered by vBulletin | XHTML | © Copyright 2003-2008 XILO Communications Ltd. All rights reserved. E&OE