|
Web design and Programming Discuss website creation and other programming topics. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||
|
Quick way to validate to forms :D
Just thought other people might like to use this, its a quick way to validate all the fields of a form without doing logic statements on each one
Code:
foreach($_POST as $var){ if($var == ''){ $empty = 1; } } Code:
if($missing == '1'){ echo 'You didnt fill in all fields.'; }else{ // do your query } Code:
foreach($_POST as $var){ if($var == ''){ die("You left ($var) field empty.<br>"); } }
__________________
- My: Drawings, rants, raves, my cat, designs, and everything else i want to put on the net. Free Teamspeak servers: http://gamersnetwork.us/ Last edited by BeBop; 06-08-2005 at 05:18 PM. |
#2
|
||
|
cool
|
#3
|
||
|
Thatoneguy explained that to me last night...and no he is not Elite or Panter
__________________
|
#4
|
||
|
(it's me)
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PhShoutBox forms | Rujikin | phphq.Net Forums | 0 | 01-29-2008 09:57 PM |
Enable/Disable Forms.... | BeBop | Web design and Programming | 4 | 01-08-2006 05:25 AM |
CSS - Making forms | phphq.Net Forums | 4 | 01-05-2006 05:02 PM | |
Forms pop up | BARRACUDA | General Chat | 3 | 11-26-2005 04:05 PM |
Forms | atholon | Web design and Programming | 7 | 07-11-2005 07:56 AM |