Winnipeg Photographer


$_SERVER(‘REMOTE_ADDR’) Fatal error: Function name must be a string in:

This will be a Homer Simpson “doh” moment for you as much as it was for me. When calling Super Global Variables you have to use “[]” instead of “()”.

The code should look something like this:

echo "Your IP address is: " . $_SERVER['REMOTE_ADDR'];

The reason why you have to use [] instead of () is that the $_SERVER variable is an array and not an object/function. Hope this helps!


One Response

  1. Thank you

  2. Bamou Mehdi on August 3rd, 2011 at 3:12 pm

Leave a Reply