$nameErr = $emailErr = $mobilenoErr = $genderErr = $websiteErr = $agreeErr = ""; $name = $email = $mobileno = $gender = $website = $agree = ""; //Input fields validation if ($_SERVER["REQUEST_METHOD"] == "POST") { //String Validation if (emptyempty($_POST["name"])) { $nameErr = "Name is required"; } else { $name = input_data($_POST["name"]); // check if name only contains letters and whitespace if (!preg_match("/^[a-zA-Z ]*$/",$name)) { $nameErr = "Only alphabets and white space are allowed"; } } //Email Validation if (emptyempty($_POST["email"])) { $emailErr = "Email is required"; } else { $email = input_data($_POST["email"]); // check that the e-mail address is well-formed if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $emailErr = "Invalid email format"; } } //Number Validation if (emptyempty($_POST["mobileno"])) { $mobilenoErr = "Mobile no is required"; } else { $mobileno = input_data($_POST["mobileno"]); // check if mobile no is well-formed if (!preg_match ("/^[0-9]*$/", $mobileno) ) { $mobilenoErr = "Only numeric value is allowed."; } //check mobile no length should not be less and greator than 10 if (strlen ($mobileno) != 10) { $mobilenoErr = "Mobile no must contain 10 digits."; } } //URL Validation if (emptyempty($_POST["website"])) { $website = ""; } else { $website = input_data($_POST["website"]); // check if URL address syntax is valid if (!preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i",$website)) { $websiteErr = "Invalid URL"; } } //Empty Field Validation if (emptyempty ($_POST["gender"])) { $genderErr = "Gender is required"; } else { $gender = input_data($_POST["gender"]); } //Checkbox Validation if (!isset($_POST['agree'])){ $agreeErr = "Accept terms of services before submit."; } else { $agree = input_data($_POST["agree"]); } } function input_data($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; }
Sign Up
  • Corporate Head Office
  • Kilitch Drugs (India) Ltd.
    37, Ujagar Industrial Estate,Waman Tukaram Patil Marg, Deonar, Mumbai - 400 088. India
  • Tel : +91-22-6121 4100
  • Fax : +91-22-6703 1658
  • Email : enquiry@kilitch.com
  • Factory Location
  • Kilitch Drugs (India) Ltd.
    C-301/2, TTC Industrial Area, MIDC, Pawane, Navi Mumbai - 400 707. India.
  • Tel : +91-22-62996300
 
  • Sign Up