Thread: Curly brackets!
View Single Post
Old 05-06-2009, 04:23 PM   #17 (permalink)
allworknoplay
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Ok this is a really bad example but it does work somewhat and perhaps you can pick some stuff out of it. I personally am trying to code everything in OO now, but I just wanted to provide you with something.

Again, this is pretty bad...but it works...if anything, maybe you can learn not to do it this way...LOL...


PHP Code:
//CHECK YOUR POST VARIABLES FOR ANYTHING EMPTY
if(in_array("",$_POST)) {

//some variable is empty so set $check01 = false;
$check01 false;
}else {
$check01 true;
}

//do your other checks here
//lets just say it passes, so $check02 = true
$check02 true;

if(
$check01 == true && $check02 == true) {

//input data and send email
echo "everything checks! send email.";

}else{

echo 
"You need to enter all fields.";


allworknoplay is offline  
Reply With Quote