Hi, I had this working but after a few code revisions it has stopped. I am trying to set a variable; lets say I have $var and am trying to set it to $_SERVER['REMOTE_ADDR'] with the code:


When I do this I receive a fatal error in my PHP Debugging program and the page returns blank when you run the script. The error is: Function must be a string. I wasn't getting this before, I have no idea what I did. I might have changed something in my php.ini file because I was playing around with the settings and adjusting them to what I need them to be. So, hence I have no idea what I did, is there any way to set the results (a 4-4 byte ip address) to a string? Thanks. The image is attached or you can view it here:[bmp/jpg]

Attachments fatal_error_16.JPG 399.76 KB
8 Years
Discussion Span
Last Post by apease11

You have parenthesis around the REMOTE_ADDR.

It thinks you are trying to call a function with the name of the value of $_SERVER (which is an array) thus causing your "function must be a string" error.

Votes + Comments
Helped me with a simple function mistake.
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.