HostFX-UK
02-19-2009, 11:20 PM
The code is sending the email but when I receive it, the Sender says:
Can you tell me how to prevent this?
Here is the code:
<?php
$sql4 = "SELECT * FROM settings";
$query4 = mysql_query($sql4) or die("Cannot query
the database.<br>" . mysql_error());
while($result = mysql_fetch_array($query4)) {
$my_email = $result['adminemail'];
}
$Emaila = $_POST['Emaila'];
if ($_SERVER['REQUEST_METHOD'] != "POST"){exit;}
while(list($key,$value) =
each($_POST)){if(!(empty($value))){$set=1;}$message
= $message . "$key: $value\n\n";}
if($set!==1){header("location:
$_SERVER[HTTP_REFERER]");exit;}
$message = stripslashes($message);
$subject = "WHMaster - User '" .
$_SESSION['username'] . "' submitted a ticket!";
$headers = "From:WHMaster" . $Emaila . "\n" .
"Return-Path: " . $Emaila . "\n" . "Reply-To: " .
$Emaila . "\n";
$message = "The user '" . $_SESSION['username'] . "'
submitted a support ticket.\r\n
Please login to WHMaster Admin to view and
respond\r\nThank You";
mail($my_email,$subject,$message,$headers);
echo "<center><strong>Support Ticket
Submitted!<br>Please allow 24-48 hours for a
reply!</strong></center>";
?>
Can you tell me how to prevent this?
Here is the code:
<?php
$sql4 = "SELECT * FROM settings";
$query4 = mysql_query($sql4) or die("Cannot query
the database.<br>" . mysql_error());
while($result = mysql_fetch_array($query4)) {
$my_email = $result['adminemail'];
}
$Emaila = $_POST['Emaila'];
if ($_SERVER['REQUEST_METHOD'] != "POST"){exit;}
while(list($key,$value) =
each($_POST)){if(!(empty($value))){$set=1;}$message
= $message . "$key: $value\n\n";}
if($set!==1){header("location:
$_SERVER[HTTP_REFERER]");exit;}
$message = stripslashes($message);
$subject = "WHMaster - User '" .
$_SESSION['username'] . "' submitted a ticket!";
$headers = "From:WHMaster" . $Emaila . "\n" .
"Return-Path: " . $Emaila . "\n" . "Reply-To: " .
$Emaila . "\n";
$message = "The user '" . $_SESSION['username'] . "'
submitted a support ticket.\r\n
Please login to WHMaster Admin to view and
respond\r\nThank You";
mail($my_email,$subject,$message,$headers);
echo "<center><strong>Support Ticket
Submitted!<br>Please allow 24-48 hours for a
reply!</strong></center>";
?>
