<?php
 $data=$_GET['q'];//name
 $data2=$_GET['q2'];//value

		if($data=="cName"){
				if ($data!=""){
					echo "OK";
				}
				
		}
		if($data=="ic"){
				if (preg_match('/^[0-9]{6}-[0-9]{2}-[0-9]{4}$/', $data2)==0){
					echo "*Invalid IC";
					die();
				}
					echo "OK";			

		}if($data=="class"){
				if ($data2=="@"){
					echo "*Please select";
					die();
				}
					echo "OK";			

		}if($data=="dateOfBirth"){
				if(preg_match('/^[0-9]{2}-[0-9]{2}-[0-9]{4}$/', $data2)){ 
					echo "OK";
				}else{ 
					echo "*Please complete with this mask: 01-01-1980"; 
				}		

		}if($data=="cNo"){
				if (is_numeric($data2)){
					$length = strlen($data2);
					if($length<=5){
						echo "*Invalid Mobile number";
					}else{
						echo "OK";
					}
					
				}else{
					echo "*Limit to digits only";
					die();
				}
								

		}if($data=="address"){
				if ($data2==""){
					echo "*Please fill in";
					die();
				}
					echo "OK";			

		}if($data=="person"){
				if ($data2==""){
					echo "*Please fill in";
					die();
				}
					echo "OK";			

		}if($data=="email"){
				if (preg_match("/^[0-9a-zA-Z]\w+(\.\w+)*\@\w+(\.[0-9a-zA-Z]+)*\.[a-zA-Z]{2,4}$/", $data2)==0 ){
					echo "*Please complete with this mask: example@gmail.com";
					die();
				}
					echo "OK";			

		}if($data=="post"){
			if(is_numeric ($data2)){
				echo "OK";
			}else{
				echo "*Invalid";
				die();
			}
		}if($data=="country"){
			if($data2=="haha"){
				echo "*Please select";
				die();
			}else{
				echo "OK";
			}
		}
		
		

		


?>