Very Simple REAL Housekeeping IP Logger For Uber Housekeeping (manage)
Hey guys, this is a very simple release, this time it will ACTUALLY LOG IPs!
This is a simple code:
PHP Code:
<?php
$logfile= '/manage/pages/ip_log.html';
$IP = $_SERVER['REMOTE_ADDR'];
$logdetails= date("F j, Y, g:i a");
$fp = fopen($logfile, "a");
fwrite($fp, $logdetails);
fwrite($fp, "<br>");
fclose($fp);
?>
(Credits to who coded this, I found it on google!)
I added that code to the login.php file of the housekeeping, so everyone who goes onto the Housekeeping will have there IP, date and time logged!
Copyright (c) to the creators of this code, found from:
IP Logger - PHP - Source Code | DreamInCode.net
Download; Here!!!
:): Enjoy :thumbup1:
Re: Very Simple REAL Housekeeping IP Logger For Uber Housekeeping (manage)
Silly really? Could have just done it with SQL:
PHP Code:
$ip = $_SERVER['REMOTE_ADDR'];
$username = $_SESSION['username'];
mysql_query("INSERT INTO hk_logs(ip,username) VALUES ('$ip', '$username')");
I presume that would work just as well :L
Re: Very Simple REAL Housekeeping IP Logger For Uber Housekeeping (manage)
Logging directly into an un-secure HTML file is stupid.
Re: Very Simple REAL Housekeeping IP Logger For Uber Housekeeping (manage)
Quote:
Originally Posted by
Hejula
Silly really? Could have just done it with SQL:
PHP Code:
$ip = $_SERVER['REMOTE_ADDR'];
$username = $_SESSION['username'];
mysql_query("INSERT INTO hk_logs(ip,username) VALUES ('$ip', '$username')");
I presume that would work just as well :L
Why not just use the uber framework?
PHP Code:
$ip = $_SERVER['REMOTE_ADDR'];
dbquery("INSERT INTO hk_logs (username, ip_last) VALUES ('".USER_NAME."', '".$ip."');
inb4 invalid syntax ect.. writing this off my iPhone.
Re: Very Simple REAL Housekeeping IP Logger For Uber Housekeeping (manage)
Quote:
Originally Posted by
iPixelHotel
PHP Code:
<?php
$logfile= '/manage/pages/ip_log.html';
$IP = $_SERVER['REMOTE_ADDR'];
$logdetails= date("F j, Y, g:i a");
$fp = fopen($logfile, "a");
fwrite($fp, $logdetails);
fwrite($fp, "<br>");
fclose($fp);
?>
Uhm at what point does the IP get logged? as far as i can see only the time and date get logged.
This is from the original script:
PHP Code:
$logdetails= date("F j, Y, g:i a") . ': ' . '<a href=http://dnsstuff.com/tools/city.ch?ip='.$_SERVER['REMOTE_ADDR'].'>'.$_SERVER['REMOTE_ADDR'].'</a>';
You should have left that intact..... It would have gave u the option to see where the ip is located.
Anyways:
Do as the other guys said. use your database and maybe write a cron_script that deletes entries that are older than a week or two or what ever.
Then make a Log viewer in the housekeeping that will post the ip address with a link to Where are my results?...
Now that would be a nice release.
If u want IPixel to code the above PRESS LIKE :)
Re: Very Simple REAL Housekeeping IP Logger For Uber Housekeeping (manage)
At least I'm contributing to the forum. fagtards.
Re: Very Simple REAL Housekeeping IP Logger For Uber Housekeeping (manage)
Quote:
Originally Posted by
iPixelHotel
At least I'm contributing to the forum. fagtards.
no sure why we are fagtards, we are just helping you to improve your coding. you should listen to our advice instead of feeling attacked.
Re: Very Simple REAL Housekeeping IP Logger For Uber Housekeeping (manage)
erkay lol?
send link to all your friends to get a chance to be staff on my new hotel, tell them to register, too!;
https://www.alertpay.com/?MgT18EV0LjJkpj1k0DjCbQ%3d%3d