Hello all, remember my website?
well i need some more help
some people have been abusing the contact us form on the site unfortunately so i need a way (in php) to be able to obtain the IP Address of someone sending in a contact us, and the possibility to disallow that IP to "Contact Us" via the form
Any ideas?
EDIT: Here is the PHP Code:
code:
<?php
// get posted data into local variables
$EmailFrom = Trim(stripslashes($_POST['EmailFrom']));
$EmailTo = "admin@haboz.net";
$Subject = "Contact Us";
$Name = Trim(stripslashes($_POST['HabboName']));
$Query = Trim(stripslashes($_POST['Query']));
// validation
$validationOK=true;
if (Trim($EmailFrom)=="") $validationOK=false;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=http://www.haboz.net/v6/contact_us_error.php>";
exit;
}
// prepare email body text
$Body = "";
$Body .= "Habbo Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Query: ";
$Body .= $Query;
$Body .= "\n";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=http://www.haboz.net/v6/contact_us_ok.php>";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=http://www.haboz.net/v6/contact_us_error.php>";
}
?>