Parašė mNm.· 2009 Gru. 7 02:12:38
#8
prašom šviežias.
<?php
$admin_mail = "mail@mail.lt"; // Tavo el. pasto adresas, i kuri scriptas sius formoje ivestus duomenis
$contact_name = $_POST['contact_name'];
$contact_mail = $_POST['contact_mail'];
$contact_message = $_POST['contact_message'];
if (preg_match("/^[a-zA-Z0-9]+$/i", $contact_name) && preg_match("/^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/i", $contact_mail) && !empty($contact_message)) {
$tema = "Blabla. Laiskas nuo: ".$contact_name; // Laisko temos pavadinimas
$headers = "From: ".$contact_mail."\r\n".
"Reply-To: ".$contact_mail."\r\n".
"X-Mailer: Blablabla (PHP /" . phpversion().")";
mail($admin_mail, $tema, $contact_message, $headers);
echo "<b>Zinute sekmingai issiusta!</b>";
}
else {
?>
<form method="post">
- Vardas:<br />
<input type="text" name="contact_name" /><br />
- El. pasto adresas:<br />
<input type="text" name="contact_mail" /><br />
- Jusu klausimas ar komentaras:<br />
<textarea cols="20" rows="5" name="contact_message"></textarea><br />
<input type="submit" value="Issiusti" />
</form>
<?php
}
?>
Redagavo mNm.· 2009 Gru. 7 02:12:50