I have two forums that member fillin and info is recorded to a flat file (Actualy each form records to two different files). In both cases, I want to record the person's IP address. I asked a few days ago and was told that the best way was to use $_SERVER["REMOTE_ADDR"] which id did in the first form and it works great. However, when I tried it in my second form, it will not record the IP. Here's the code:
$fg=fopen("XXXXXXXXXXXXX/file2.txt", "a");
$addguess="Member # ".$membernum.", "."Guess= ".$firstguess.$secondguess.$thirdguess.$fourthguess.", "."# Correct= ".$counter." Day= ".$date." IP= ".$_SERVER["REMOTE_ADDR"]."\n";
flock($fg, 2); //lock file for writing
fwrite($fg, $addguess);
flock($fg, 3); // release write lock
fclose($fg); // close date file after writing member number
++++++++++++++++++
It will record everything except the IP. Any ideas why it will not record the IP?
Thanks,
Cy