<?php

     $conn = new mysqli("localhost","root","","event");
     $role = test_input($_POST['role']);
	$fname = test_input($_POST['fname']);
	$lname = test_input($_POST['lname']);
	$email = test_input($_POST['email']);
	$address = test_input($_POST['address']);
	$phone = test_input($_POST['phone']);
	$gender = test_input($_POST['gender']);
	$city = test_input($_POST['city']);
	$country = test_input($_POST['country']);
	$username = test_input($_POST['username']);
	$password = test_input($_POST['password']);
	
	//$Date = test_input($_POST['Date']);
	//$joining  = test_input($_POST['joining']);


	function test_input($data) {
  $data = trim($data);
  $data = stripslashes($data);
  $data = htmlspecialchars($data);
  $data = mysql_real_escape_string($data);
  return $data;
}


	//$insert = "INSERT INTO `ragistar`(`id`, `name`, `age`, `gender`, `email`, `salary`, `qualification`) VALUES ([$fname],[$fage],

	//[$fgender],[$fEmail],[$fsalary],[$fQualification])";
	
	
	$insert = "insert into signup (role,fname,lname,email,address,phone,gender,city,country,username,password)  
	values ('".$role."','".$fname."','".$lname."','".$email."','".$address."','".$phone."','".$gender."','".$city."','".$country."','".$username."','".$password."')";
	$confirmation = mysqli_query($conn,$insert);
			if($confirmation){
				header('Location: event2.php');
			}
		
	else{
		echo "Kindly click on Register button to complete the form process";
	}
	


?>