shank888 Posted May 5, 2008 Share Posted May 5, 2008 Hey all I have a couple questions. First off is I would like to get a users IP address and send it into a MySQL database. is there a function to do this. As well I would like to know if there is a PHP function that will automaticially generate a list of all the countries. I have search but have come up with nothing. and another question lol sorry. I am wanting to use the IP address also to gather the country where the user is from and in a select menu select that country to be picked first for easy registration on my site or w/e. if anyone knows hwo to do that as well that will be really cool . Thanx Quote Link to comment Share on other sites More sharing options...
trq Posted May 5, 2008 Share Posted May 5, 2008 A users ip address can be found within the $_SERVER array. $_SERVER['REMOTE_ADDR']. As for the rest of your questions, take a look at the geoip extension. Quote Link to comment Share on other sites More sharing options...
Fadion Posted May 5, 2008 Share Posted May 5, 2008 I am wanting to use the IP address also to gather the country where the user is from and in a select menu select that country to be picked first for easy registration on my site. I wont bother so much for such an approach. It wont hurt users to select their country manually. Quote Link to comment Share on other sites More sharing options...
shank888 Posted May 9, 2008 Author Share Posted May 9, 2008 A users ip address can be found within the $_SERVER array. $_SERVER['REMOTE_ADDR']. As for the rest of your questions, take a look at the geoip extension. I keep getting this error: Fatal error: Call to undefined function geoip() in : FILENAME CENSORED using: <?php $record = geoip('http://phpfreaks.com'); if ($record) { print_r($record); } ?> Quote Link to comment Share on other sites More sharing options...
trq Posted May 9, 2008 Share Posted May 9, 2008 Is the geoip extension installed? Quote Link to comment 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.