stubarny Posted March 13, 2007 Share Posted March 13, 2007 Hi everyone, I run two websites from the same host and both have the following code in a form to record the ip address of a user making a submission. <INPUT TYPE=HIDDEN NAME="uip" VALUE="<?php echo "$REMOTE_ADDR"?>" readonly> Strangely the code works on one website but gives an empty value on the other. The site that isn't working uses sessions - can this cause problems? Any ideas why the code might not be working? Thanks for your help! Stewart Link to comment https://forums.phpfreaks.com/topic/42548-solved-recording-ip-addres-problem/ Share on other sites More sharing options...
Orio Posted March 13, 2007 Share Posted March 13, 2007 Because one site has register globals enabled and one doesnt. It's recommended to turn register globals off. This will work on both tho: <INPUT TYPE=HIDDEN NAME="uip" VALUE="<?php echo "$_SERVER['REMOTE_ADDR']"?>" readonly> Orio. Link to comment https://forums.phpfreaks.com/topic/42548-solved-recording-ip-addres-problem/#findComment-206439 Share on other sites More sharing options...
stubarny Posted March 13, 2007 Author Share Posted March 13, 2007 many thanks Link to comment https://forums.phpfreaks.com/topic/42548-solved-recording-ip-addres-problem/#findComment-206538 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.