Thank you for clearing that up.
I hate to be annoying and ask you another question, but if you don't mind I'm getting a syntax error on line 2 and 18 where it starts with "public function..." and on 58/59 where the if/else statement is. Do you know why this would be happening?
<?php
public function getRealIpAddr()
{
if(!empty($_SERVER['HTTP_CLIENT_IP']))
{
$ip=$_SERVER['HTTP_CLIENT_IP'];
}
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip=$_SERVER['REMOTE_ADDR'];
}return $ip;
}
public function mailSomeone($toWho, $fromWho, $sysSubj, $sysMsg)
{
$msgTemplate = '
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>'.$sysSubj.'</title>
<style type="text/css">
background-color: #f1f1f1;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #666666;
text-decoration: none;
</style>
</head>
<body>
<table width="650" border="0" bgcolor="#FFF" id="wrapper">
<tr>
<td align="center" valign="top">'.$sysMsg.'</td>
</tr>
</table>
</body>
</html>';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'Content-type: text/html; charset=us-ascii' . "\r\n";
$headers .= 'From:' .$fromWho. "\r\n";
$headers .= 'Reply-To: ' .$fromWho. "\r\n";
$headers .= '1\r\nX-MSMail-Priority: High' . "\r\n";
$headers .= 'X-Mailer: RiversHacia, LLC Mail Controller v2.0' . "\r\n";
mail($toWho, $sysSubj, $sysMsg, $headers);
}
?>
<?php
if(!isset($_POST['name']))||(empty($_POST['name']))||(trim($_POST['name']) == ""){echo "Please Provide your Name.";} // just making sure something is posted with the form
else{
$timeofMsg = date('m d, Y g:ia', time());
$ipOfPoster = getRealIpAddr();
$toWho = 'sales@endorsebro.com';
$fromWho = $_POST['Email'];
$sysSubj = 'Sales Inquiry';
$sysMsg = "
Name: $name <br>
Business Name: $business_name <br>
Phone Number: $phone_number <br>
Email Address: $Email <br>
Website: $website <br>
State: $state <br>
Budget: $budget <br>
Comments: $comments <br> <br> <br> <br>
Time/Date: timeofMsg <br>
IP Posted: $ipOfPoster
";
mailSomeone($toWho, $fromWho, $sysSubj, $sysMsg);
}
?>