![]() |
|
#1
|
|||
|
|||
validate formhow to validate a form?
it will check whether it is empty or not, if yes, it will ask user to enter the value, the value for name can't in the numeric form, the IC Number can't in the string form. it also check the email is in the correct format. thank you |
|
#2
|
|||
|
|||
|
Validation is essentially a bunch of IF statements, which check if some variable is good or not.
The first & most important is: PHP Code:
Don't do if($id), because if $id is set to zero/false, the if's parameters will be false - even though it's set. Say to check if $id is an integer between 1 and 100 (inclusive), have this: PHP Code:
Checking email addresses is tricky, using things called regular expressions, which essentially define a template for a string, and you see if your email address string fits the template or not. Thankfully the work is done for you by many people, so do a google or look here: www.zend.com GF |
|
#3
|
|||
|
|||
|
thanx a lot
|
|
#4
|
||||
|
||||
validating valid email adress syntaxesWe have a function here to validate email address (syntax): http://www.desilva.biz/forum/viewtopic395.php
As usual, would appreciate feedback if it doesn't work for you (since I personally don't use it much). __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
Recent GIDBlog
A Week in Kuwait by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why doesnt my form work correctly? | rhino1616 | Web Design Forum | 2 | 06-Nov-2003 17:21 |
| Automate a data change php form | mjfmn | MySQL / PHP Forum | 4 | 20-Oct-2003 09:37 |
| simple form from generated page | zuzupus | Web Design Forum | 0 | 17-Sep-2003 09:27 |
| form in a table cell | blelisa | Web Design Forum | 1 | 19-Aug-2003 09:14 |
| Best way to validate numbers (ids)? | JdS | MySQL / PHP Forum | 1 | 20-Jan-2003 03:55 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The