Go Back   Novahq.net Forum > Computers > Web design and Programming
FAQ Community Calendar Today's Posts Search

Web design and Programming Discuss website creation and other programming topics.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-08-2005, 01:33 PM
BeBop is offline BeBop
Registered User

Join Date: Jun 2002
Posts: 600

Send a message via ICQ to BeBop Send a message via AIM to BeBop Send a message via Yahoo to BeBop
Biggrin 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;
	}
}
if your going to be doing a query, after that you can do:

Code:
if($missing == '1'){
echo 'You didnt fill in all fields.';
}else{
// do your query
}
And perhaps if you didnt need to do something special you could just have it die
Code:
foreach($_POST as $var){
	if($var == ''){
	die("You left ($var)  field empty.<br>");
	}
}
Just thought i'd post this for people to save time ^.^
__________________
- 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.
Reply With Quote
  #2  
Old 06-08-2005, 03:35 PM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

cool
Reply With Quote
  #3  
Old 06-08-2005, 04:42 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
Thatoneguy explained that to me last night...and no he is not Elite or Panter
__________________
Reply With Quote
  #4  
Old 06-08-2005, 05:20 PM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

(it's me)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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 XinG 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


All times are GMT -5. The time now is 09:22 AM.




Powered by vBulletin®