Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

IP Stealer Help


ghost's Avatar
0 0

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!";
}


?> ```

ghost's Avatar
0 0

Are you sure that you have a working SMTP? And that you've written the right path in the php.ini file.


ghost's Avatar
0 0

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 :)


p4plus2's Avatar
Member
0 0

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 >.>.