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

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

if($data=="phoneNo"){
		if (preg_match("/^[0-9]{2,5}-[0-9]{7,10}$/", $data2)==0){
			echo "*Please complete with this mask: 016-1112222 or 07-1112222";
			die();
		}
		echo "OK";			

}
if($data=="address"){
		if ($data2==""){
			echo "*Please fill in address";
			die();
		}
		echo "OK";			
}
if($data=="contactName"){
		if ($data2==""){
			echo "*Please fill in contact person name";
			die();
		}
		echo "OK";			
}
if($data=="email"){
		if(preg_match("/^[a-zA-Z]\w+(\.\w+)*\@\w+(\.[0-9a-zA-Z]+)*\.[a-zA-Z]{2,4}$/", $data2)==0){
			echo "*Email must comply with this mask: xxx@xxx.com";
			die();
		}
		echo "OK";
}
	
		

		


?>