Morris2 Posted October 20, 2011 Share Posted October 20, 2011 Hello How do I fetch a current visitors ip address, and turn it into a variable? The visitor should only be able to enter the same form once, so I want to compare the current visitor ip address with ip addresses in the database to achieve this. Best regards Morris Link to comment https://forums.phpfreaks.com/topic/249467-how-do-i-fetch-a-current-visitors-ip-address-and-turn-it-into-a-variable/ Share on other sites More sharing options...
Adam Posted October 20, 2011 Share Posted October 20, 2011 It's already in the array variable $_SERVER, but if you wish to add it to a separate variable you can use: $ip = $_SERVER['REMOTE_ADDR']; Link to comment https://forums.phpfreaks.com/topic/249467-how-do-i-fetch-a-current-visitors-ip-address-and-turn-it-into-a-variable/#findComment-1280860 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.