Jump to content

Recommended Posts

Posted
Hello everyone.
 
Until December my site showed the IP of the client with the following PHP script:
<?
function getRealIP() {
	if (!empty($_SERVER['HTTP_CLIENT_IP']))
		return $_SERVER['HTTP_CLIENT_IP'];
		
	if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
		return $_SERVER['HTTP_X_FORWARDED_FOR'];
	
	return $_SERVER['REMOTE_ADDR'];
}
?>

I have noticed that since January that script does not work anymore.
 
What is the problem and how do I solve it?
 
I appreciate your help.

 

  • Like 1
Posted

Please remove your short tags and replace them with

<?php
Thanks for answering.
 
I used "<? Php" instead of "<?" but it still does not work.

 

Any other suggestions?

Posted

There's no space in the tag. The P needs to be right next to the ?

 

I wanted to say: "<?php" instead of "<?" But it still does not work

Posted
Thank you all for your time. The problem was solved.

 

I found that in another part of the source code it said "<?" instead of "<?php"
Posted

If you were wondering why this occurred, we recently removed the function for PHP short tags as they were causing errors on Tommy.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...