DeathStar Posted February 6, 2007 Share Posted February 6, 2007 Hi i want to create a login page.. one of the futures i want to put in is that the script will automatically fill in your user name in a text box if you have registered. then you just enter the password. here's the part where i need help! I want it to get the user name from the ip if it exists in the database. any help would be good!. Quote Link to comment https://forums.phpfreaks.com/topic/37354-get-the-user_name-by-ip/ Share on other sites More sharing options...
fenway Posted February 6, 2007 Share Posted February 6, 2007 That's a very bad, bad idea... thousands of users can have the same ip. Quote Link to comment https://forums.phpfreaks.com/topic/37354-get-the-user_name-by-ip/#findComment-178572 Share on other sites More sharing options...
artacus Posted February 6, 2007 Share Posted February 6, 2007 MUCH better off using a cookie if you want to do that. Quote Link to comment https://forums.phpfreaks.com/topic/37354-get-the-user_name-by-ip/#findComment-178600 Share on other sites More sharing options...
DeathStar Posted February 7, 2007 Author Share Posted February 7, 2007 hmm.. doesnt each pc have thier own uniqe ip?? how would i do it with a cookie? Quote Link to comment https://forums.phpfreaks.com/topic/37354-get-the-user_name-by-ip/#findComment-179008 Share on other sites More sharing options...
fenway Posted February 7, 2007 Share Posted February 7, 2007 hmm.. doesnt each pc have thier own uniqe ip?? how would i do it with a cookie? Not if they're behind a firewall/router/gateway/etc. At best, you can uniquely identify visitors with session IDs (stored in a cookie, as artacus suggested). Quote Link to comment https://forums.phpfreaks.com/topic/37354-get-the-user_name-by-ip/#findComment-179209 Share on other sites More sharing options...
DeathStar Posted February 12, 2007 Author Share Posted February 12, 2007 oh yea i forgot about proxy's :s ill think ill do it with a cookie Quote Link to comment https://forums.phpfreaks.com/topic/37354-get-the-user_name-by-ip/#findComment-182676 Share on other sites More sharing options...
worldworld Posted February 12, 2007 Share Posted February 12, 2007 You can do it with sessions too.. Quote Link to comment https://forums.phpfreaks.com/topic/37354-get-the-user_name-by-ip/#findComment-182705 Share on other sites More sharing options...
DeathStar Posted February 13, 2007 Author Share Posted February 13, 2007 How? Quote Link to comment https://forums.phpfreaks.com/topic/37354-get-the-user_name-by-ip/#findComment-183571 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.