If you are asking for log in code for this So it may help you see this code:
<?phperror_reporting(0);$user = $_POST['user']; //Set UserName$pswrd = $_POST['pswrd']; //Set Passwordif(isset($user, $pswrd)) {include('/config.php'); //Initiate the MySQL connection// To protect MySQL injection (more detail about MySQL injection)$myusername = stripslashes($user);$mypassword = stripslashes($pswrd);$myusername = mysqli_real_escape_string($dbC, $myusername);$mypassword = mysqli_real_escape_string($dbC, $mypassword);$sql="SELECT * FROM studetail WHERE name='$myusername' and pass='$mypassword'";$result=mysqli_query($dbC, $sql);// Mysql_num_row is counting table row$count=mysqli_num_rows($result);// If result matched $myusername and $mypassword, table row must be 1 rowif($count==1){// Register $myusername, $mypassword and redirect to file "admin.php"session_register("hi");session_register("password");$_SESSION['name']= $myusername;header("location:home.php");}else{?><script type="text/javascript" language="javascript">alert("User name or password not corroct");window.location.href='index.php';</script><?php }}?>
In this code we are matching the username and password from database and counting result , on the basis of result we are redirecting to home page or index page. I hope this will help you.