Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> formularz z pamiecia
kalu111
post
Post #1





Grupa: Zarejestrowani
Postów: 68
Pomógł: 0
Dołączył: 22.07.2006

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


mam taki prosty skrypt
  1. <?php
  2. if ( isset($_POST['submit']) ) {
  3. //Obslygujemy formularz
  4. } else {
  5. //Wyswietlamy formularz
  6. }
  7. ?>
Skrypt obslugiwany jest przez jeden plik. Dlaczego gdy np nie wpisze w dane pole textowe jakiejs wrtosci, skrypt to wykryje i cofne sie do formularza, to reszta pol wypelnionych czysci sie, a przeciez mam wpisane:
  1. <?php
  2. ....value="' . $POST['name'] . '" />
  3. ?>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
mokry
post
Post #2





Grupa: Zarejestrowani
Postów: 374
Pomógł: 23
Dołączył: 3.06.2006
Skąd: Katowice

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


Poniżej przedstawiam Ci przykładowy formularz z weryfikacja adresu e-mail... Jak chcesz to skorzystaj z tego (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)
  1. <script language="javascript">
  2.  
  3. function SprawdzFormularz(f) {
  4.  
  5. if (f.kto.value=='') {
  6. alert('Nie podaleś/aś niku/imienia.');
  7. return false;
  8. }
  9.  
  10. if (f.email.value=='') {
  11. alert('Nie podaleś/aś adresu e-mail.');
  12. return false;
  13. }
  14.  
  15. if ( ((f.email.value.indexOf('@',1))==-1)||(f.email.value.indexOf('.',1))==-1 ) {
  16. alert('Podaleś/aś błędny adres e-mail');
  17. return false;
  18. }
  19.  
  20. if (f.tresc.value=='') {
  21. alert('Nie podaleś/aś treści komentarza.');
  22. return false;
  23. }
  24.  
  25. else {
  26. return true;
  27. }
  28. }
  29.  
  30. </script>
  31. <h4>Dodaj komentarz:</h4>
  32. Wypełnij proszę poniższe pola aby dodać komentarz do wybranej przez Ciebie noty.<br/>
  33. Wypełnij proszę także Twój adres e-mail.<br/><br/><br/>
  34. <form id="form1" name="form1" method="post" action="adres_pliku_wykonawczego.php" onsubmit="return SprawdzFormularz(this)">
  35. <table width="100%" cellspacing="0" cellpadding="2" border="0">
  36.  
  37. <tr>
  38. <td width="20%"><div align="right">Imię/Nick: </div></td>
  39. <td width="80%"><label>
  40. <input name="kto" type="text" id="kto" size="20" />
  41. </label></td>
  42. </tr>
  43. <tr>
  44.  
  45. <td><div align="right">E-mail: </div></td>
  46. <td><label>
  47. <input name="email" type="text" id="email" size="20" />
  48. </label></td>
  49. </tr>
  50. <tr>
  51. <td valign="top"><div align="right">Treść komentarza: </div></td>
  52.  
  53. <td><label>
  54. <textarea name="tresc" cols="60" rows="10"></textarea>
  55. </label></td>
  56. </tr>
  57. <tr>
  58. <td><div align="right"></div></td>
  59. <td>&nbsp;</td>
  60. </tr>
  61.  
  62. <tr>
  63. <td>&nbsp;</td>
  64. <td><label>
  65. <input type="submit" value="Dodaj komentarz" />
  66. </label></td>
  67. </tr>
  68. </table>
  69. </form>
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: 10.10.2025 - 04:35