- Kod: Zaznacz cały
<?php
if (count($_POST))
{
////////// USTAWIENIA //////////
$email = 'From: dragon@dragon.ugu.pl'; // Adres e-mail adresata
$subject = 'Zamowienie Pracy - DragOn.ugu.pl'; // Temat listu
$message = 'Dziękujemy za wysłanie formularza'; // Komunikat
$error = 'Wystapil blad podczas wysylania formularza'; // Komunikat bledu
$charset = 'iso-8859-2'; // Strona kodowa
//////////////////////////////
$head =
"MIME-Version: 1.0\r\n" .
"Content-Type: text/plain; charset=$charset\r\n" .
"Content-Transfer-Encoding: 8bit";
$body = '';
foreach ($_POST as $name => $value)
{
if (is_array($value))
{
for ($i = 0; $i < count($value); $i++)
{
$body .= "$name=" . (get_magic_quotes_gpc() ? stripslashes($value[$i]) : $value[$i]) . "\r\n";
}
}
else $body .= "$name=" . (get_magic_quotes_gpc() ? stripslashes($value) : $value) . "\r\n";
}
echo mail($email, "=?$charset?B?" . base64_encode($subject) . "?=", $body, $head) ? $message : $error;
}
else
{
?>
<form action="?" method="post">
<table bgcolor="silver">
<tr>
<td colspan="2" align="right">
<h3>------------ZAMOW PRACE------------</h3></br>
<form action="..." enctype="text/plain">
<b>Typ pracy:</b>
<input type="text" name="Typ Pracy" />
</br>
<b>Wymiary: </b>
<input type="text" name="Wymiary" />
</br>
<b>Czas pracy:</b>
<input type="text" name="Czas Pracy" />
</br>
<b>Kolorystyka:</b>
<input type="text" name="Kolorystyka" />
</br>
<b>Cena preferowana:</b>
<input type="text" name="Cena" />
</br>
<b>Kontakt:</b>
<input type="text" name="Kontakt" />
</br>
<b>Obrazek*:</b>
<input type="text" name="Obrazek" />
</td>
</tr>
<tr>
</br>
<td align="center">
</br>
<input type="submit" value="Wyslij!" />
<input type="reset" value="Wyczysc Dane" />
</td>
</table>
</form>
<?php
}
Demo: www.dragon.ugu.pl/zamow.php