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 Quote 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']; Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.