Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Sprawdzanie fomularza - wyrażenia reg PCRE
aleo
post
Post #1





Grupa: Zarejestrowani
Postów: 137
Pomógł: 0
Dołączył: 23.08.2008

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


  1. <form action="" method=get >
  2.  <input type="text" name="mail">
  3.  <input type="submit" value="send"></form>
  4.  
  5.  <?php
  6.  
  7.  
  8.  
  9.  if (isset($_GET['send'])) {
  10.      if ( preg_match("/w+@.w{2,4}/" . $_GET['send']=! 1 ) ) {
  11.          echo"dobrze" ;
  12.      }
  13.      else "zle";
  14.  }
  15.  
  16.  
  17.  ?>


Witam

Dlaczego powyższy fomularz nie działa ?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
aleo
post
Post #2





Grupa: Zarejestrowani
Postów: 137
Pomógł: 0
Dołączył: 23.08.2008

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


pogubiłem się (IMG:http://forum.php.pl/style_emoticons/default/sciana.gif)

kod
  1. <?php
  2.  
  3.  
  4.  
  5.  
  6. if(preg_match("//^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,4}$//",$_GET['mail']))
  7. {
  8. echo 'ok';
  9. }
  10. else echo 'nie<BR>';
  11. print_r($_GET);
  12.  ?>
  13.    </body>
  14. </html>



O to chodziło ?

na dodatek wyskoczył error Warning: preg_match() [function.preg-match]: Unknown modifier '[' in /home/desk/public_html/php/ke/listing_5/listing_5_5.php on line 23 (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

Nie wiem gdzie mam umiescic te //
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: 15.10.2025 - 09:08