30-11-2009, 23:56
1. Później coś podrzucę jak znajdę coś ciekawego w google ale czy nie lepiej użyć zegara w JS?
2.
To taki skrypt z mojej strony. Zmień sobie co tam potrzebujesz.
2.
Kod:
<body>
<?php
//to podaj swoje dane
$adres_strony="adres strony"; //musisz wpisać adres strony bez http i bez / na końcu
$adres_email="e-mail"; //twoj mail
//tego nie ruszaj
if (isset($_GET['wyslij'])){
$tresc='wiadomość:<br>'.$_POST['tresc'].' ';
$temat = "Wiadomość ze strony - ".$_POST['temat']." ";
$adres_email=$_POST['dokogo'];
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-2\n";
$headers .= "From: \"" . addslashes($adres_strony) . "\" <" .$adres_strony. ">\n";
$headers .= "Reply-To: \"" . addslashes($adres_strony) . "\" <" .$adres_strony. ">\n";
$headers .= "X-Mailer: PHP " . phpversion() . "\n";
if(mail($adres_email, $temat, $tresc, $headers)){
echo "Wiadomość została wysłana";
}
else{
echo "wystąpił błąd, wiadomość nie została wysłana";
}
}
else{
echo'<form action="'; echo $_SERVER["PHP_SELF"]; echo'?wyslij=tak" method="post">
<table><tr><td>Odbiorca: </td><td><input name="dokogo" type="text" size="50" maxlength="140" /></td></tr><tr><td>Temat: </td><td><input name="temat" type="text" size="50" maxlength="140" /></td></tr><tr><td>Treść: </td><td><textarea name="tresc" cols="50" rows="6"></textarea></td></tr></table><br>
<br><input type="submit" value="Wyślij" />
</form>';
}
?>
</body>
To taki skrypt z mojej strony. Zmień sobie co tam potrzebujesz.