Dan Friedman said:
Thanks in advance.
I actually got the code from a NP post!...
<?php
//Start your PHP tags
foreach($_POST as $key => $val){
$$key = trim($val);
}
function em($ema){
if(!eregi('[a-z0-9]+[_a-z0-9-]*(\.[_a-z0-9-]+)*@[a-z?G0-9]+(-[a-z?G0-9]+)*(\.[a-z?G0-9-]+)*(\.[a-z]{2,4})$',
$ema, $ema_er)){
return 0;
} else {
return 1;
}
}
if(em($email) != 0){
$error = "<span class='error'>Error<br />The
email you entered is an invalid email address, Please input the correct email!</span>";
include("feedback.php");
exit();
}
if((!$name) || (!$email) || (!$comments)) {
$error = "<span class='error'><br /></span>";
include("feedback.php");
exit();
} else {
$ip = $_SERVER['REMOTE_ADDR'];
$ref = $_SERVER['HTTP_REFERER'];
$to = "
[email protected]";
$date = date("m/d/Y");
$time = date("h:i:s A");
$subject = "My .com form has a message for you";
$msg = "Feedback from $username.
@ $email
Here are their comments:
$comments \n\n
Came from: $ref
At: $ip| $date | $time";
$mailheaders = "From:
[email protected]<[email protected]> \n\r";
$mailheaders .= "X-Mailer: DP-Mail X-2 \n\r\n\r";
mail($to, $subject, $msg, $mailheaders);
$error = "<span class='true'>We have successfully sent your
contact form! </span>";
include("feedback.php");
exit();
} // Close PHP tags.