Hello all - happy holidays!
I am trying my hand at creating a php script for my site. So far, not so good. Please understand that I know nothing about PHP but am interested in learning how to make this form work! 😃
Thank you in advance for you help, I truly appreciate it.
I tried adding in the script from this website:
http://www.ibdhost.com/contact/
So far, I think I have done everything right. I changes the email and redirection And I keep getting this 'error' when I click send.
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/tbrooks/syntricdesign.com/html/sendeail.php on line 11
Parse error: parse error in /home/tbrooks/syntricdesign.com/html/sendeail.php on line 11
My code looks like this: (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php?$ip = $POST['ip']; ?$httpref = $POST['httpref']; ?$httpagent = $POST['httpagent']; ?$visitor = $POST['visitor']; ?$visitormail = $POST['visitormail']; ?$notes = $POST['notes'];?$attn = $_POST['attn'];??>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sendemail Script</title>
</head>
<body>
<!-- Required: YOUR email ($myemail).
Required: Add the link for the 'next page' (at the bottom) -->
<?php
$myemail = "tamara@syntricdesign.com";
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
}
if(empty($visitor) || empty($visitormail) || empty($notes )) {
echo "<h2>Use Back - fill in all fields</h2>\n";
}
echo $badinput;
$todayis = date("l, F j, Y, g:i a") ;
$attn = $attn ;
$subject = $attn;
$notes = stripcslashes($notes);
$message = " $todayis [EST] \n
Attention: $attn \n
Message: $notes \n
From: $visitor ($visitormail)\n
Additional Info : IP = $ip \n
Browser Info: $httpagent \n
Referral : $httpref \n
";
$from = "From: $visitormail\r\n";
if ($myemail != "")
mail($myemail, $subject, $message, $from);
?>
<p align="center">
Date: <?php echo $todayis ?>
<br />
Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> )
<br />
Attention: <?php echo $attn ?>
<br />
Message:<br />
<?php $notesout = str_replace("\r", "<br/>", $notes);
echo $notesout; ?>
<br />
<?php echo $ip ?>
<br /><br />
<a href="thankyou.php"> Next Page </a>
</p>
</body>
</html>
My code looks like this: (HTML)
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>
<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />
--- Questions and form ---
<input type="submit" value="Send Mail" />
Any help would be amazing - I feel very lost!
Tamarab