View Single Post
ישן 02-12-10, 14:11   # 3
mrns
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Apr 2010
הודעות: 346

mrns לא מחובר  

HTML
קוד:
<form method="post" name="sendm" action="mail.php">
	<p>Name*</p>
		<input type="text" name="customer_name" />
	<br/>
	<p>Email*</p>
		<input type="text" name="email"/>
	<br/>
	<p>Telephone</p> 
		<input type="text" name="phone" /><br/>
	<br/>
	Comment*<br/> 
		<textarea rows="6" cols="40" type="text" name="comment"></textarea> 
	<br/>

	<br/>
	<input type="reset" value="Reset">
 	<input type="submit" name="sendm" value="Send">       
</form>
PHP

קוד:
<?php

$name = $_POST['customer_name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$comment = $_POST['comment'];

if(isset($_POST['sendm']) && $name != "" && $email != "" && $phone != "" && $comment != "")   {    
    $mail_to = "המייל שלך כאן";

    $subject = "הודעה חדשה מהאתר";
	$message = "Name : $name<br />Email : $email<br />Telephone : $phone<br /><br />Comment: $comment";

	$headers  = 'MIME-Version: 1.0' . "\r\n";
	$headers .= 'Content-type: text/html; charset=windows-1255' . "\r\n";

	mail($mail_to, $subject, $message, $headers);

    print '<script>alert("ההודעה נשלחה.")
    location.replace("index.html")</script>';
}
else    {
        print '<script>alert("ישנם פרטים חסרים בטופס.")
        location.replace("mail.html")</script>';
}

?>
__________________
<°)))))><
mrns - קידוד ותכנות אתרים

Last edited by mrns; 02-12-10 at 14:14..
  Reply With Quote