<?php
	$username =$_POST['username'];
	$password =$_POST['password'];

	//to prevent mysql injection
	$username = stripcslashes($username);
	$password = stripcslashes($password);
	$username = mysql_real_escape_string($username);
	$password = mysql_real_escape_string($password);

	//connect to the server and select detabase
	mysql_connect("localhost","root", "");
	mysql_select_db("event");

	//query the detabase for user
	$result = mysql_query("select * from signup where username ='$username' and password = '$password'")
	            or die("Faild to query database".mysql_error());
	$row = mysql_fetch_array($result);
	if ($row['username'] == $username && $row['password'] == $password) {
		echo "UserName : ".$row['username'];
		echo " password :  ".$row['password'];
		header("Location: Customer_details1.php");
	}else{
		echo "Faild to login!";
	}            

?>