Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Sprawdzenie formularza, Mam taki problem z formularzem
adziozone
post
Post #1





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 26.02.2011

Ostrzeżenie: (0%)
-----


Witam,

Mam taki problem z formularzem, chciałbym żeby była w nim funkcja taka ze jak jakaś rubryka nie jest uzupełniona to żeby poniżej wyświetlał się komunikat np. „wypełnij wszystkie rubryki” z góry dzięki za pomoc.

<?php
if (count($_POST))
{
////////// USTAWIENIA //////////
$email = 'adziozone@op.pl'; // Adres e-mail adresata
$subject = ' kontakt'; // 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="?" method="post">

<!-- Komentarz -->
<p align="right">
<b>
<font size="3" color="#ffffff">Imię i nazwisko:</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</b>
<font color="#000080">
<input maxLength="24" name="Imię i nazwisko:[]" size="30" style="font-weight: 700" value="<?= $imie; ?>" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font>
<br><br>
<b>
<font size="3" color="#ffffff">Adres e-mai:</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</b>
<font color="#000080">
<input maxLength="29" name="Adres -mail:[]" size="30" style="font-weight: 700" value="<?= $adres; ?>" >
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
</font>
<br>
<b>
<font size="3" color="#ffffff">Telefon:</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</b>
<font color="#000080">
<input maxLength="29" name="Telfon:[]" size="30" style="font-weight: 700" value="<?= $telefon; ?>">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
</font>
<br>
</p>
<p align="right">
&nbsp;&nbsp;&nbsp;
<b>
<font size="3" color="#ffffff">Treść:
</b>
</font>
<textarea rows="8" name="tresc[]" cols="40"></textarea>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
&nbsp;&nbsp;&nbsp;
<br>
<center>
<input type="submit" name="wyslij" value="Wyślij" style="background-color: #000000; font-family: Verdana; color: #FFFFFF; font-size: 8pt; font-weight: bold; border: 1px solid #FFFFFF; ">
&nbsp;&nbsp;&nbsp;
<input type="reset" name="reset" value="Wyczyść" style="background-color: #000000; font-family: Verdana; color: #FFFFFF; font-size: 8pt; font-weight: bold; border: 1px solid #FFFFFF; ">
</center>
<input type="hidden" name="location" value="dziekuje.htm">

</form>
<?php
}
?>




Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
adziozone
post
Post #2





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 26.02.2011

Ostrzeżenie: (0%)
-----


Widzę ze przeznaczenie forum się zmieniło, to już nie to dawniej przez takie wpisy jak Twój.
Lepiej by to wyglądało jak byś napisał „Ja jestem zbyt leniwy, aby Ci pomóc”

Wielki dzięki za pomoc.
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 5.10.2025 - 23:45