Jump to content


Photo

form to mail script help


  • Please log in to reply
No replies to this topic

#1 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 18 June 2006 - 06:09 PM

hey all rite here it is
i wanna make a email form that i can have ppl email me there info and i picture

i have got the form set up for info just need to know what to add to it so they can upload a picture and send it to me.... can any 1 help

below is code so far

<?

$mailto = 'contact@werun2win.com';

$subject = "werun2win.com";

$formurl = "http://www.werun2win.com/contact.html";

$thankyouurl = "http://www.werun2win.com/thanks.html";

$uself = 0;


$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n";
$name = $_POST['name'];
$email = $_POST['email'];
$comments = $_POST['comments'];
$http_referrer = getenv( "HTTP_REFERER" );


if((!$name=="none")&&($comments=="none")){
echo "Sorry please fill in all the form<br><a href='contact.html'>Please try agin!</a>";
exit;
}




if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}

$messageproper =

"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------------------------------------------\n" .
"Name of sender: $name\n" .
"Email of sender: $email\n" .
"------------------------- COMMENTS -------------------------\n\n" .
$comments .
"\n\n------------------------------------------------------------\n";


if(!eregi("^[a-z0-9_]+@[a-z0-9\-]+\.[a-z0-9\-\.]+$" ,$email)) {

echo"please add a correct email address<br><a href='contact.html'>Please try agin!</a>";
exit;

}else{

mail($mailto, $subject, $messageproper,
"From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" );
header( "Location: $thankyouurl" );
exit;
}
?>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users