I'll admit to being rather inexperienced with PHP, with it being years since I've really used it and even then I found it a pain. Once again I'm struggling and google isn't helping.
All I want to is append the users IP address to a string.
I can append to a string fine:
$mailbody .= "IP address:"
I can print out the IP address:
echo $_SERVER['REMOTE_ADDR'];
But can't get the IP address in the string. The page just won't load (I get an empty browser).
I've tried:
$mailbody .= "IP address: $_SERVER[REMOTE_ADDR]\n";
And various other subtly different cominations, to no avail.
What gives?
All I want to is append the users IP address to a string.
I can append to a string fine:
$mailbody .= "IP address:"
I can print out the IP address:
echo $_SERVER['REMOTE_ADDR'];
But can't get the IP address in the string. The page just won't load (I get an empty browser).
I've tried:
$mailbody .= "IP address: $_SERVER[REMOTE_ADDR]\n";
And various other subtly different cominations, to no avail.
What gives?