![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 96 Pomógł: 0 Dołączył: 19.10.2007 Ostrzeżenie: (0%) ![]() ![]() |
Witam!
Dopiero od niedawna próbuje swoich sił w php, html, i C++ więc pojawił się problem na mojej drodze (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) A dokładnie mój nauczyciel informatyki nie był w stanie zrobić formularza w php więc ja sie za to zbrałem lecz mój formularz wysyła tylko połowe danych :/ Tzn. Graficznie jest ok, wysyła maila ale z nie pełnymi danymi (IMG:http://forum.php.pl/style_emoticons/default/sad.gif) Problem 2 jeżeli chodzi o wysyłanie tekstu w formularzu to coś tam daje rade ale żeby wysłać coś takiego to już mam problem (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif) <br/><B/>C. Poziom konkursu: Prosze zaznaczyc wybrane poziomy, w których szkola zamierza wziasc udzial<br/><B/> <p><input type="checkbox" name="C1" value="ON"> Click on Starters <input type="checkbox" name="C2" value="ON"> Click on Movers <input type="checkbox" name="C3" value="ON"> Click on Flyers</p> <p><input type="checkbox" name="C4" value="ON"> Click on 1 <input type="checkbox" name="C5" value="ON"> Click on 2 <input type="checkbox" name="C6" value="ON"> Click on 3 <input type="checkbox" name="C7" value="ON"> Click on 4</p> <p> </p> Jak możecie powiedzcie mi jak zrobić żeby to też zawierał list z formularza (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) Tutaj cały kod który napisałem : <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Zgloszenie udzialu w konkursie "Clickonmaniac"</title> </head> <body> <div align=center> <h3>Zgloszenie udzialu w konkursie "Clickonmaniac"</h3> <?php $gesendet = $_POST['gesendet']; $imie = $_POST['imie']; $nazwisko = $_POST['nazwisko']; $nazwa = $_POST['nazwa szkoly']; $email = $_POST['email']; $nr = $_POST['nr.telefonu']; $ul = $_POST['ulica i numer']; $kod = $_POST['kod pocztowy']; $miasto = $_POST['miasto']; $nr2 = $_POST['nr.telefonu']; if ($gesendet == "Wyslij") { # Ihre E-Mail-Adresse $an ="maniek1992-1992@o2.pl"; # Diese Nachricht wird an Ihre E-Mail-Adresse gesendet $text ="Witaj,\n Napisal: $imie $nazwisko \n\n ====\n $imie\n==== ====\n $nazwisko\n==== ====\n $nazwa\n==== ====\n $email\n==== ====\n $nr\n==== ====\n $ul\n==== ====\n $kod\n==== ====\n $miasto\n==== ====\n $nr2\n====\n\nSie können $imie $nazwisko unter dieser $email erreichen."; mail($an,$betreff,$text,"From: ".$email); echo "Wiadomosc zostala wyslana"; } else { ?> <script type="text/javascript"> function eingaben_ueberpruefen(){ var mail = document.Formular.email.value; if (document.Formular.imie.value.length < 1){ alert("Sie haben noch keinen Imie eingegeben!") document.Formular.imie.focus(); return false; } else if (document.Formular.nazwisko.value.length < 1){ alert("Bitte geben Sie Ihren Nazwisko ein"); document.Formular.nazwisko.focus(); return false; } else if (mail.length < 3 || mail.indexOf ('@',0) == -1 || mail.indexOf ('.',0) == -1){ alert("Bitte geben Sie eine gültige E-Mail-Adresse ein.") document.Formular.email.select(); return false; } else if (document.Formular.nazwa.value.length < 1){ alert("Bitte geben Sie einen Nazwa Szkoły ein!") document.Formular.nazwa.focus(); return false; } else if (document.Formular.nr.value.length < 1){ alert("Bitte geben Sie eine Nachricht ein!") document.Formular.nr.focus(); return false; } else if (document.Formular.ul.value.length < 1){ alert("Bitte geben Sie eine Nachricht ein!") document.Formular.ul.focus(); return false; } else if (document.Formular.kod.value.length < 1){ alert("Bitte geben Sie eine Nachricht ein!") document.Formular.kod.focus(); return false; } else if (document.Formular.miasto.value.length < 1){ alert("Bitte geben Sie eine Nachricht ein!") document.Formular.miasto.focus(); return false; } else if (document.Formular.nr2.value.length < 1){ alert("Bitte geben Sie eine Nachricht ein!") document.Formular.nr2.focus(); return false; } else return true; } </script> <form name="Formular" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>" onSubmit="return eingaben_ueberpruefen();"> <table cellPadding=5 cellSpacing=5 border=5> <tr> <br/><B/>A. Dane szkoly:<br/><B/> <td><b>Nazwa szkoly:</b></td> <td><input type="text" name="nazwa" size="35" maxlength="40"></td> </tr> <tr> <td><b>Ulica i numer:</b></td> <td><input type="text" name="ul" size="35" maxlength="40"></td> </tr> <td><b>Kod pocztowy:</b></td> <td><input type="text" name="kod" size="35" maxlength="40"></td> </tr> <td><b>Miasto:</b></td> <td><input type="text" name="miasto" size="35" maxlength="40"></td> </tr> <td><b>Nr.Telefonu:</b></td> <td><input type="text" name="nr2" size="45" maxlength="60"></td> <tr> <form name="Formular" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>" onSubmit="return eingaben_ueberpruefen();"> <table cellPadding=5 cellSpacing=5 border=5> <tr> <br/><B/>B. Dane nauczyciela koordynujacego:<br/><B/> <td><b>Imie:</b></td> <td><input type="text" name="imie" size="35" maxlength="40"></td> </tr> <tr> <td><b>Nazwisko:</b></td> <td><input type="text" name="nazwisko" size="35" maxlength="40"></td> </tr> <tr> <td><b>E-Mail:</b></td> <td><input type="text" name="email" size="35" maxlength="40"></td> </tr> <tr> <td><b>Nr.Telefonu:</b></td> <td><input type="text" name="nr2" size="45" maxlength="60"></td> <tr> <form name="Formular" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>" onSubmit="return eingaben_ueberpruefen();"> <table cellPadding=5 cellSpacing=5 border=5> <tr> <br/><B/>C. Poziom konkursu: Prosze zaznaczyc wybrane poziomy, w których szkola zamierza wziasc udzial<br/><B/> <p><input type="checkbox" name="C1" value="ON"> Click on Starters <input type="checkbox" name="C2" value="ON"> Click on Movers <input type="checkbox" name="C3" value="ON"> Click on Flyers</p> <p><input type="checkbox" name="C4" value="ON"> Click on 1 <input type="checkbox" name="C5" value="ON"> Click on 2 <input type="checkbox" name="C6" value="ON"> Click on 3 <input type="checkbox" name="C7" value="ON"> Click on 4</p> <p> </p> <th colspan=2><br> <input type="submit" name="gesendet" value="Wyslij"> * <input type="reset"> </th> </tr> </table> </form> <?php } ?> </div> </body> </html> Jeżeli chcecie zobaczyć ten formularzyk to jest on na stronie clickonmaniac.republika.pl.. Z góry dzięki za pomoc bo musze to w poniedziałek oddać (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif) Pozdrawiam, |
|
|
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 81 Pomógł: 0 Dołączył: 11.10.2007 Skąd: http://localhost/ Ostrzeżenie: (0%) ![]() ![]() |
Ale jeżeli to zadanie to nie zrobie tegoza ciebie w końcu to zadanie więc powinieneś to umieć. Są małe szanse iż ktoś ci odpowie ja co dam wskazówke kliknij tu
Ten post edytował michu2510 19.10.2007, 20:33:43 |
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 96 Pomógł: 0 Dołączył: 19.10.2007 Ostrzeżenie: (0%) ![]() ![]() |
to nie jest zadanie ;p moja nauczycielka tego nie potrafi a ja sobie w miare radze wiec zaoferowalem pomoc..
jak by ktos był tak miły i powiedział co źle zrobiłem (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) Ten post edytował andegrand2 19.10.2007, 20:54:03 |
|
|
![]()
Post
#4
|
|
Grupa: Zarejestrowani Postów: 897 Pomógł: 40 Dołączył: 16.12.2003 Skąd: Warszawa Ostrzeżenie: (0%) ![]() ![]() |
Użyj bbcode, bo nie można się połapać w tym co wrzuciłeś i pokaż, jak odbierasz dane.
|
|
|
![]()
Post
#5
|
|
Grupa: Zarejestrowani Postów: 81 Pomógł: 0 Dołączył: 11.10.2007 Skąd: http://localhost/ Ostrzeżenie: (0%) ![]() ![]() |
O ile się nie myle to pomoc się oferuje jak sie cos potrafi ;p ale napisz jakie dane pobiera a jakie nie
|
|
|
![]()
Post
#6
|
|
Grupa: Zarejestrowani Postów: 96 Pomógł: 0 Dołączył: 19.10.2007 Ostrzeżenie: (0%) ![]() ![]() |
mój kod w bbcode (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Kod <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Zgloszenie udzialu w konkursie "Clickonmaniac"</title> </head> <body> <div align=center> <h3>Zgloszenie udzialu w konkursie "Clickonmaniac"</h3> <?php $gesendet = $_POST['gesendet']; $imie = $_POST['imie']; $nazwisko = $_POST['nazwisko']; $nazwa = $_POST['nazwa szkoly']; $email = $_POST['email']; $nr = $_POST['nr.telefonu']; $ul = $_POST['ulica i numer']; $kod = $_POST['kod pocztowy']; $miasto = $_POST['miasto']; $nr2 = $_POST['nr.telefonu']; if ($gesendet == "Wyslij") { # Ihre E-Mail-Adresse $an ="maniek1992-1992@o2.pl"; # Diese Nachricht wird an Ihre E-Mail-Adresse gesendet $text ="Witaj,\n Napisal: $imie $nazwisko \n\n ====\n $imie\n==== ====\n $nazwisko\n==== ====\n $nazwa\n==== ====\n $email\n==== ====\n $nr\n==== ====\n $ul\n==== ====\n $kod\n==== ====\n $miasto\n==== ====\n $nr2\n====\n\nSie können $imie $nazwisko unter dieser $email erreichen."; mail($an,$betreff,$text,"From: ".$email); echo "Wiadomosc zostala wyslana"; } else { ?> <script type="text/javascript"> function eingaben_ueberpruefen(){ var mail = document.Formular.email.value; if (document.Formular.imie.value.length < 1){ alert("Sie haben noch keinen Imie eingegeben!") document.Formular.imie.focus(); return false; } else if (document.Formular.nazwisko.value.length < 1){ alert("Bitte geben Sie Ihren Nazwisko ein"); document.Formular.nazwisko.focus(); return false; } else if (mail.length < 3 || mail.indexOf ('@',0) == -1 || mail.indexOf ('.',0) == -1){ alert("Bitte geben Sie eine gültige E-Mail-Adresse ein.") document.Formular.email.select(); return false; } else if (document.Formular.nazwa.value.length < 1){ alert("Bitte geben Sie einen Nazwa Szkoły ein!") document.Formular.nazwa.focus(); return false; } else if (document.Formular.nr.value.length < 1){ alert("Bitte geben Sie eine Nachricht ein!") document.Formular.nr.focus(); return false; } else if (document.Formular.ul.value.length < 1){ alert("Bitte geben Sie eine Nachricht ein!") document.Formular.ul.focus(); return false; } else if (document.Formular.kod.value.length < 1){ alert("Bitte geben Sie eine Nachricht ein!") document.Formular.kod.focus(); return false; } else if (document.Formular.miasto.value.length < 1){ alert("Bitte geben Sie eine Nachricht ein!") document.Formular.miasto.focus(); return false; } else if (document.Formular.nr2.value.length < 1){ alert("Bitte geben Sie eine Nachricht ein!") document.Formular.nr2.focus(); return false; } else return true; } </script> <form name="Formular" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>" onSubmit="return eingaben_ueberpruefen();"> <table cellPadding=5 cellSpacing=5 border=5> <tr> <br/><B/>A. Dane szkoly:<br/><B/> <td><b>Nazwa szkoly:</b></td> <td><input type="text" name="nazwa" size="35" maxlength="40"></td> </tr> <tr> <td><b>Ulica i numer:</b></td> <td><input type="text" name="ul" size="35" maxlength="40"></td> </tr> <td><b>Kod pocztowy:</b></td> <td><input type="text" name="kod" size="35" maxlength="40"></td> </tr> <td><b>Miasto:</b></td> <td><input type="text" name="miasto" size="35" maxlength="40"></td> </tr> <td><b>Nr.Telefonu:</b></td> <td><input type="text" name="nr2" size="45" maxlength="60"></td> <tr> <form name="Formular" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>" onSubmit="return eingaben_ueberpruefen();"> <table cellPadding=5 cellSpacing=5 border=5> <tr> <br/><B/>B. Dane nauczyciela koordynujacego:<br/><B/> <td><b>Imie:</b></td> <td><input type="text" name="imie" size="35" maxlength="40"></td> </tr> <tr> <td><b>Nazwisko:</b></td> <td><input type="text" name="nazwisko" size="35" maxlength="40"></td> </tr> <tr> <td><b>E-Mail:</b></td> <td><input type="text" name="email" size="35" maxlength="40"></td> </tr> <tr> <td><b>Nr.Telefonu:</b></td> <td><input type="text" name="nr2" size="45" maxlength="60"></td> <tr> <form name="Formular" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>" onSubmit="return eingaben_ueberpruefen();"> <table cellPadding=5 cellSpacing=5 border=5> <tr> <br/><B/>C. Poziom konkursu: Prosze zaznaczyc wybrane poziomy, w których szkola zamierza wziasc udzial<br/><B/> <p><input type="checkbox" name="C1" value="ON"> Click on Starters <input type="checkbox" name="C2" value="ON"> Click on Movers <input type="checkbox" name="C3" value="ON"> Click on Flyers</p> <p><input type="checkbox" name="C4" value="ON"> Click on 1 <input type="checkbox" name="C5" value="ON"> Click on 2 <input type="checkbox" name="C6" value="ON"> Click on 3 <input type="checkbox" name="C7" value="ON"> Click on 4</p> <p> </p> <th colspan=2> <input type="submit" name="gesendet" value="Wyslij"> * <input type="reset"> </th> </tr> </table> </form> <?php } ?> </div> </body> </html> Pozdrawiam, Odświeżam!! Odświeżam!! Odświeżam!! Odświeżam!! Czy ktoś zna się dobrze na tym i jest mi w stanie pomóc (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) |
|
|
![]()
Post
#7
|
|
Grupa: Zarejestrowani Postów: 17 Pomógł: 1 Dołączył: 24.01.2007 Ostrzeżenie: (0%) ![]() ![]() |
Zrobiłeś mały zamęt w tym skrypcie. Otworzyłeś 3 razy <form> zamknąłeś tylko jeden, podejrzewam, że to było twoim błędem przez który nie pobierało danych. Do tego nie wiedziałem w jaki sposób wysyłasz dane, zrobiłem to jak ja bym to zrobił. Ominąłem całkowicie obsługę błędów ponieważ nie chciało mi się bawić (była po niemiecku :/). Nie jestem profesjonalistą, a zwykłym początkującym, ale ja bym to zrobił tak:
Nie jedźcie po mnie jak są błędy. (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif) u mnie to działa, jedyne co to nie sprawdziłem czy wysyła maile. |
|
|
![]()
Post
#8
|
|
Grupa: Zarejestrowani Postów: 96 Pomógł: 0 Dołączył: 19.10.2007 Ostrzeżenie: (0%) ![]() ![]() |
hej dzięki wielkie za pomoc (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) kilku żeczy sie juz dowiedzialem co zle robilem ale nadal dane jakie wysyla na maila nie sa pelne tzn nadal tylko imie nazwisko email i miasto a ulicy telefonow itp nie ma...
to e-mail jaki dostalem z formularza..: Witaj,<br /> Napisal: Gienek Pawlak<br /> ====<br /> Gienek<br />==== ====<br /> Pawlak<br />==== ==== ==== ==== lolek666@o2.pl ==== ==== ==== ==== ==== ==== ==== ==== Zmc ==== ==== ==== Sie können Gienek Pawlak unter dieser lolek666@o2.pl erreichen. . Zaznaczone poziomy: Click on Starters, , , , , to wszystko po niemiecku i te tagi html po usuwam ladnie ale chodzi mi o te dane bo to moj najwiekszy problem mecze sie juz z tym 2 dzien.. |
|
|
![]()
Post
#9
|
|
Grupa: Zarejestrowani Postów: 17 Pomógł: 1 Dołączył: 24.01.2007 Ostrzeżenie: (0%) ![]() ![]() |
Znalazłem, przecież masz inaczej nazwane elementy w formularzu, a inaczej w skrypcie do odczytu. (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif) Wcześniej skopiowałem i nie zauważyłem. Pozdrawiam.
// do tego w formularzu dwa razy nazwałeś numer telefonu "nr2". Powinno być tak:
Ten post edytował adriano321 23.10.2007, 20:35:35 |
|
|
![]()
Post
#10
|
|
Grupa: Zarejestrowani Postów: 96 Pomógł: 0 Dołączył: 19.10.2007 Ostrzeżenie: (0%) ![]() ![]() |
Ale ze mnie gapa (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif) Już wszystko ślicznie działa zrobiłem obsługe błędów itp (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) Dzięki ci wielkie za pomoc ...
|
|
|
![]() ![]() |
![]() |
Aktualny czas: 23.08.2025 - 06:14 |