I'm trying to get the user's ip address once the page loads with the following:
<?php $user_ip = $_SERVER['REMOTE_ADDR']; ?> and trying to print the value like so:
<input id="ip" name="ip" value="<?php $user_ip = echo ($user_ip); ?>" type="hidden"> for some reason it won't print. Any ideas?
$user_ip =and just doecho $user_ip;ipform value to be correct.echois a language construct. it has no return value.$foo = echo ...is utterly pointless.$_SERVER['REMOTE_ADDR'];again not get it from a POSTed form. If you're just displaying it to the user for their own benefit, why is it hidden?