![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 9 Pomógł: 0 Dołączył: 22.05.2011 Ostrzeżenie: (0%) ![]() ![]() |
Witam
Mam problem z formularzem niestety po wypełnieniu przychodzą do mnie puste wiadomości Imię: Telefon: Email: Wiadomosc: brakuje całej zawartości która jest wpisywana, czy to jest problem serwera czy jakiś błąd w kodzie podaje kod z pliku kontakt.html CODE <b> FORMULARZ </b> </td> </tr> <tr><td style="text-align:left;padding:4px;background-color:#01203D;color:#FFFFFF;font-size:11px;"> <center> <form name='form' method='post' action='formularz.php'> <table class='' style='text-align:left;width:210px; margin-left:0px;margin-top:5px;'> <tr><td width='80' class='naglowek_td'> Imie i Nazwisko:</td><td class='naglowek_td'> <input style='width:120px' type='text' name='imie' style=''></td></tr> <tr><td width='80' class='naglowek_td'> e-mail:</td><td class='naglowek_td'> <input style='width:120px' type='text' name='email' style=''></td></tr> <tr><td width='80' class='naglowek_td'> Telefon:</td><td class='naglowek_td'> <input style='width:120px' type='text' name='tel' style=''></td></tr> <tr><td colspan='2' class='naglowek_td'> <br/> Wiadomość: <br/><textarea style='width:195px;height:100px;' type='text' name='tresc'></textarea></td></tr> <tr><td style='text-align:right;' colspan='2'> <input style='margin-right:0px;' type='submit' name='submit' value='wyślij'> </td></tr></table> </center> A to zawartość pliku formularz.php CODE <?php function check_email($email) { $wyr = "^[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)*"; $wyr .= "@([a-zA-Z0-9_-]+)(\.[a-zA-Z0-9_-]+)*(\.[a-zA-Z]{2,4})$"; if(ereg($wyr, $email)){ return true; } else{ return false; } } //------------------------------------------------------------------------------ echo "<table class=\"\" style=\"width:210px;text-align:left; margin-left:0px;margin-top:5px;\"> <tr><td colspan=\"2\" class=\"naglowek_td\" style=\"text-align:center;\"><form name=\"form\" method=\"post\"> "; if (check_email($_POST["email"]) && !empty($_POST["tresc"]) && !empty($_POST["email"]) ) { echo " <span style='color:#A74625;' class=\"formularz_uwaga\"><b>Wiadomość została wysłana. Dziękujemy</b> </span></td></tr>" ; } echo "<tr><td > Imie i nazwisko:</td><td> <input style=\"width:120px\" type=\"text\" value=\"$imie\" name=\"imie\"></td></tr>"; //------------------------------------------------------------------------------- if (empty($_POST["email"])) { echo "<tr><td width=\"80\" class=\"naglowek_td\">e-mail: </td><td class=\"naglowek_td\"><input style=\"vertical-align:middle;width:120px\" type=\"text\" name=\"email\" style=\"vertical-align:top;\"><br/><span style=\"margin-left:10px;\" class=\"formularz_uwaga\"><b> - * Uzupełni pole.</b></span></td></tr>"; } else { if(!check_email($_POST["email"])) { echo "<tr><td width=\"80\" class=\"naglowek_td\">e-mail: </td><td class=\"naglowek_td\"><input style=\"width:120px\" type=\"text\" name=\"email\" value=\"$email\" style=\"vertical-align:top;\"><br/><span style=\"margin-left:10px;\"class=\"formularz_uwaga\"><b> - * Błąd e-mail.</b></span></td></tr>"; } else { echo "<tr><td width=\"80\" class=\"naglowek_td\">e-mail: </td><td class=\"naglowek_td\"><input style=\"width:120px\" type=\"text\" name=\"email\" value=\"$email\" style=\"vertical-align:top;\"></td></tr>"; } } echo "<tr><td width=\"80\" >Telefon:</td><td> <input style=\"vertical-align:middle;width:120px\" type=\"text\" value=\"$tel\" name=\"tel\"></td></tr>"; //--------------------------------------------------------------------------------- if (empty($_POST["tresc"])) { echo "<tr><td colspan=\"2\" class=\"naglowek_td\"><br/>Wiadomośc: <span style=\"margin-left:10px;\" class=\"formularz_uwaga\"> <b>- * Uzupełni pole.</b></span> </td></tr><tr><td class=\"naglowek_td\" colspan=\"2\" style=\"text-align:center;\"><textarea style=\"width:195px;height:60px;\" type=\"text\" name=\"tresc\"></textarea></td></tr>"; } else { echo "<tr><td colspan=\"2\" class=\"naglowek_td\"><br/>Wiadomość: </td></tr><tr><td class=\"naglowek_td\" colspan=\"2\"><textarea style=\"width:195px;height:60px;\" type=\"text\" name=\"tresc\" value=\"$tresc\"></textarea></td></tr>"; } // ------------------------------------------------------------------------------ echo "<tr><td style=\"text-align:right;\" colspan=\"2\"><input type=\"submit\" name=\"submit\" value=\"wyślij\">"; echo "</form></td></tr> </table>";//zamykamy formularz if (check_email($_POST["email"]) && !empty($_POST["tresc"]) && !empty($_POST["email"]) ) { $wiadomosc = "Imię: $imie\nTelefon: $tel\nEmail: $email\nWiadomosc:\n$tresc\n"; $head = "Reply-To: $email\r\nFrom: $email\nX-Mailer: PHP\nX-Sender: biuro@cyfra.info.pl\nMIME-version: 1.0\nContent-type: text/plain; charset=iso-8859-2\nContent-transfer-encoding: 8BIT\n"; mail ("biuro@cyfra.info.pl", "Zapytanie ofertowe", $wiadomosc, $head); } ?> W czym tkwi problem, nie znam się na php Z góry serdecznie dziękuje za pomoc |
|
|
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 1 447 Pomógł: 191 Dołączył: 26.03.2008 Ostrzeżenie: (0%) ![]() ![]() |
Kiepsko mi się to czyta, mogłeś dać w tagi php a nie code.
W każdym bądź razie, jeśli przesyłasz POSTem dane i masz takie pole
to zmienną ta będzie znajdować się w : a nie
-------------------- :)
|
|
|
--robertinog-- |
![]()
Post
#3
|
Goście ![]() |
A w którym to dokładnie miejscu musi być zmienione
|
|
|
--robertinog-- |
![]()
Post
#4
|
Goście ![]() |
Coś chyba nie tak bo jak zmieniam tą nazwę zmiennej to mi komunikat wywala i w ogóle nie wysyła
|
|
|
![]() ![]() |
![]() |
Aktualny czas: 20.08.2025 - 20:28 |