mam skrypt w php - formularz
Kod
if (empty($_POST['submit'])) {
echo "<table border="0"><form method="\"post\"">
<tbody><tr>
<td>Treść wiadomości</td>
<td><textarea name="\"tresc\"" style="" 250px;="" height:="">
100px\"></textarea></td>
</tr>
<tr>
<td>Imię, nazwisko lub nick</td>
<td><input name="\"imie\"" style="" 250px\="" type="\"text\""></td>
</tr>
<tr>
<td>Adres e-mail</td>
<td><input name="\"email\"" style="" 250px\="" type="\"text\""></td>
</tr>
<tr>
<td> </td>
<td><input name="\"submit\"" value="\"Wyślij\"" type="\"submit\"">
<input value="\"Od" nowa\="" type="\"reset\""></td></tr>
</tbody>
</form></table>";
}
elseif (!empty($_POST['tresc']) && !empty($_POST['imie']) &&
!empty($_POST['email'])) {
$message = "Treść wiadomości:\n$_POST[tresc]\nWysłał:
$_POST[imie]\ne-mail: $_POST[email]";
$header = "From: $_POST[imie] <$_POST[email]>";
@mail("adres@domena.pl","Wiadomosc ze strony WWW","$message","$header")
or die('Nie udało się wysłać wiadomości');
echo "<div align="\"center\""><strong>Wiadomość została wysłana
poprawnie!</strong></div>";
}
else echo "<span style="" #ff0000;="" text-align:="" center;\="">Wypełnij
wszystkie pola formularza!</span>";
?>
echo "<table border="0"><form method="\"post\"">
<tbody><tr>
<td>Treść wiadomości</td>
<td><textarea name="\"tresc\"" style="" 250px;="" height:="">
100px\"></textarea></td>
</tr>
<tr>
<td>Imię, nazwisko lub nick</td>
<td><input name="\"imie\"" style="" 250px\="" type="\"text\""></td>
</tr>
<tr>
<td>Adres e-mail</td>
<td><input name="\"email\"" style="" 250px\="" type="\"text\""></td>
</tr>
<tr>
<td> </td>
<td><input name="\"submit\"" value="\"Wyślij\"" type="\"submit\"">
<input value="\"Od" nowa\="" type="\"reset\""></td></tr>
</tbody>
</form></table>";
}
elseif (!empty($_POST['tresc']) && !empty($_POST['imie']) &&
!empty($_POST['email'])) {
$message = "Treść wiadomości:\n$_POST[tresc]\nWysłał:
$_POST[imie]\ne-mail: $_POST[email]";
$header = "From: $_POST[imie] <$_POST[email]>";
@mail("adres@domena.pl","Wiadomosc ze strony WWW","$message","$header")
or die('Nie udało się wysłać wiadomości');
echo "<div align="\"center\""><strong>Wiadomość została wysłana
poprawnie!</strong></div>";
}
else echo "<span style="" #ff0000;="" text-align:="" center;\="">Wypełnij
wszystkie pola formularza!</span>";
?>
No i mam ladne okienko w DIVach
Kod
<div style=" margin-left:30px; margin-top:11px; margin-right:20px; line-height:14px " class="b2">Twoje imię i
nazwisko:</div>
<div style="margin-left:30px; margin-top:0px;">
<input type="text" class="b" style=" width:217px; height:20px; border-style:solid; border-width:1px;
border-color:#BEC0C2; background-color:#E7E7E7 " size="20" name="name"></div>
nazwisko:</div>
<div style="margin-left:30px; margin-top:0px;">
<input type="text" class="b" style=" width:217px; height:20px; border-style:solid; border-width:1px;
border-color:#BEC0C2; background-color:#E7E7E7 " size="20" name="name"></div>
jak umiescic divy zamiast tabel w skrypcie ?
Pozdrawiam
Starfire