Home
- Details
-
Category: Opracowania
-
Published: 31 May 2011
-
Hits: 16330
Je?li chcesz skontaktowa? si? z autorem strony napisz na adres:
This email address is being protected from spambots. You need JavaScript enabled to view it.
{source}
<?php
// You can place PHP like this
if (count($_POST))
{
////////// USTAWIENIA //////////
$email = '
This email address is being protected from spambots. You need JavaScript enabled to view it.
'; // Adres e-mail adresata
$subject = 'Pytanie ze strony www'; // Temat listu
$message = 'Dzi?kujemy za wys?anie formularza'; // Komunikat
$error = 'Wyst?pi? b??d podczas wysy?ania formularza'; // Komunikat b??du
$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="index.php?option=com_content&view=article&id=67&Itemid=54" method="post">
<h3> Formularz kontaktowy </h3>
<h3> Adres mailowy: <input type="text" name="mail" size="40" /></h3>
<h3> Tre?? wiadomo?ci: </h3><textarea name="tresc" cols="50" rows="7">Prosz? wpisa? pytanie</textarea>
<br />
<input type="submit" value="Wy?lij" />
</form>
<?php
}
?>
{/source}