[ create a new paste ] login | about

Link: http://codepad.org/ogfrZQhD    [ raw code | output | fork ]

PHP, pasted on Sep 4:
<?php

function validateCustomForm(){

$os0 = "";
$os1 = "5";
$os2 = "6";
$os3 = "5";
		if(!empty($os0)){
		//do nothing
		}else{
                $w = "width is missing";
		echo $w;
		}
		if(!empty($os1)){
		//do nothing
		}else{
                $h = "height is missing";
		echo $h;
		}
		if(!empty($os2)){
		//do nothing
		}else{
                $c = "color is missing";
		echo $c;
		}
		if(!empty($os3)){
		//do nothing
		}else{
                $q = "qty is missing";
		echo $q;
		}

		}//end function

$valid = validateCustomForm();

if(!empty($valid)){
    echo "something is missing";
} else{
    echo "all good";
}


?>


Output:
1
width is missingall good


Create a new paste based on this one


Comments: