...

View Full Version : mail php



cgibie
01-06-2006, 09:31 PM
Hello I have this code, but it doesn't tell me any errors and echos any text, what's wrong with it?




<?php
function checkOK($field)
{
if (eregi("\r",$field) || eregi("\n",$field)){
die("Invalid Input!");
}
}

$name = $_POST['name'];
checkOK($name);
$email = $_POST['email'];
checkOK($email);
$comments=$_POST['comments'];
checkOK($comments);
$to = "dave555th@yahoo.com";
$message = "$name just contacted you. He said: \n $comments \n";
if ($mail($to, "Comments", $message, "From: $email\n")) {
echo "Thanks for your comments.";
}
else {
echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
}
?>

cgibie
01-06-2006, 09:35 PM
I got it... sorry guys :) still, I don't understand the function, any references to help me understanding that function?

vinyl-junkie
01-07-2006, 08:21 AM
The manual (http://www.php.net/function.mail) is your best friend. :)

GO ILLINI
01-07-2006, 08:27 AM
well... if you die() nothing else will be seen...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum