Hooo Posted August 27, 2009 Share Posted August 27, 2009 Been searching and can't find out how to do these.. Just simply want them to be logged on signup and maybe login and store last 3/5 login IPs if thats possible.. Data also, so date registered and date last logged in. Is there any suggestions on how to go about doing this? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/172194-date-and-ip-log/ Share on other sites More sharing options...
ignace Posted August 27, 2009 Share Posted August 27, 2009 upon registration: INSERT INTO members SET registered_date = now(), ip_address = $_SERVER['REMOTE_ADDR'] upon login: UPDATE members SET last_login_date = now(), ip_address = $_SERVER['REMOTE_ADDR'] WHERE id = $id Quote Link to comment https://forums.phpfreaks.com/topic/172194-date-and-ip-log/#findComment-907902 Share on other sites More sharing options...
Hypermx Posted August 27, 2009 Share Posted August 27, 2009 NOT TESTED! <?php $ip = $_SERVER['REMOTE_ADDR']; $pagina = $_SERVER['REQUEST_URI']; $datum = date("d-m-y / H:i:s"); $invoegen = $datum . " - " . $ip . " - " . $pagina . "<br />"; $fopen = fopen("ips.html", "a"); fwrite($fopen, $invoegen); fclose($fopen); ?> Quote Link to comment https://forums.phpfreaks.com/topic/172194-date-and-ip-log/#findComment-907904 Share on other sites More sharing options...
ignace Posted August 27, 2009 Share Posted August 27, 2009 NOT TESTED! <?php $ip = $_SERVER['REMOTE_ADDR']; $pagina = $_SERVER['REQUEST_URI']; $datum = date("d-m-y / H:i:s"); $invoegen = $datum . " - " . $ip . " - " . $pagina . "<br />"; $fopen = fopen("ips.html", "a"); fwrite($fopen, $invoegen); fclose($fopen); ?> Dan had je het wel even in het engels kunnen zetten Quote Link to comment https://forums.phpfreaks.com/topic/172194-date-and-ip-log/#findComment-907909 Share on other sites More sharing options...
Hypermx Posted August 27, 2009 Share Posted August 27, 2009 Sorry, I can't understand Dutch, I just made a fast search on good, and posted this Its a amazing how much help you can find on google, just by typing in the magic words and pressing the big button! :b Quote Link to comment https://forums.phpfreaks.com/topic/172194-date-and-ip-log/#findComment-907926 Share on other sites More sharing options...
ignace Posted August 27, 2009 Share Posted August 27, 2009 Sorry, I can't understand Dutch Then how do you know that what I said was in Dutch? Quote Link to comment https://forums.phpfreaks.com/topic/172194-date-and-ip-log/#findComment-907953 Share on other sites More sharing options...
Hypermx Posted August 27, 2009 Share Posted August 27, 2009 Translater ftw :b Quote Link to comment https://forums.phpfreaks.com/topic/172194-date-and-ip-log/#findComment-907971 Share on other sites More sharing options...
ignace Posted August 28, 2009 Share Posted August 28, 2009 Its a amazing how much help you can find on google, just by typing in the magic words and pressing the big button! :b Besides if you are using work from someone else shouldn't you need to be crediting them? Quote Link to comment https://forums.phpfreaks.com/topic/172194-date-and-ip-log/#findComment-908186 Share on other sites More sharing options...
ignace Posted August 28, 2009 Share Posted August 28, 2009 Translater ftw :b LOL Quote Link to comment https://forums.phpfreaks.com/topic/172194-date-and-ip-log/#findComment-908188 Share on other sites More sharing options...
oni-kun Posted August 28, 2009 Share Posted August 28, 2009 Besides if you are using work from someone else shouldn't you need to be crediting them? $ip = $_SERVER['REMOTE_ADDR;']; //Code provided by Ignace echo "Your IP is: $ip"; Quote Link to comment https://forums.phpfreaks.com/topic/172194-date-and-ip-log/#findComment-908192 Share on other sites More sharing options...
ignace Posted August 28, 2009 Share Posted August 28, 2009 Besides if you are using work from someone else shouldn't you need to be crediting them? $ip = $_SERVER['REMOTE_ADDR;']; //Code provided by Ignace echo "Your IP is: $ip"; You don't need to credit my work everything I do is open-source But I wonder what happens if someone would post code that is copyright protected? The forum won't be held responsible so the poster is? Oh my! Quote Link to comment https://forums.phpfreaks.com/topic/172194-date-and-ip-log/#findComment-908193 Share on other sites More sharing options...
oni-kun Posted August 28, 2009 Share Posted August 28, 2009 Besides if you are using work from someone else shouldn't you need to be crediting them? $ip = $_SERVER['REMOTE_ADDR;']; //Code provided by Ignace echo "Your IP is: $ip"; You don't need to credit my work everything I do is open-source But I wonder what happens if someone would post code that is copyright protected? The forum won't be held responsible so the poster is? Oh my! Copyrighted code does not need credit, as it's illegal to copy it in the first place? Quote Link to comment https://forums.phpfreaks.com/topic/172194-date-and-ip-log/#findComment-908198 Share on other sites More sharing options...
ignace Posted August 28, 2009 Share Posted August 28, 2009 as it's illegal to copy it in the first place? I wasn't anymore referring to adding a copyright notice. But it just hit me to what would happen if they would? Like for example material they bought and provided source code from that material. Quote Link to comment https://forums.phpfreaks.com/topic/172194-date-and-ip-log/#findComment-908201 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.