Okay, here my PHP script - first and second page.
First page:
<!doctype html>
<html>
<head>
<title>Login System</title>
<link href="rcd.css" rel="stylesheet" type="text/css">
<link href="font.css" rel="stylesheet" type="text/css">
<link href="submit.css" rel="stylesheet" type="text/css">
</head>
<body>
<form action ="checklogin.php" method="POST">
<center>
<fieldset style='width:800px;'>
<table cellspacing="10" cellpadding="10">
<p id="font">Please Login to RCD's database</p>
<tr><td>Username:</td><td><input type="text" name="user" placeholder="Username"></td></tr>
<tr><td>Password:</td><td><input type="password" name="pass" placeholder="Password"></td></tr>
<tr><td colspan="2" align="center"><input id="submit" type="submit" name="submitted" value="Log in"></td></tr>
</table>
</fieldset>
</center>
</form>
</body>
</html>
Second page:
<?php
session_start();
require_once("require.php");
$username= stripslashes($_POST['user']);
$password = stripslashes($_POST['pass']);
$username = mysqli_real_escape_string($Garydb, $username);
$password = mysqli_real_escape_string($Garydb, $password);
$log = "SELECT username, password, type FROM username WHERE username ='".$username."' AND password = '".$password."'";
$result = mysqli_query($Garydb, $log);
$count = mysqli_num_rows($result);
if ($count == 1) {
$_SESSION['username'];
header('location:register.php');
}
else {
die(header('location:denied.php'));
}
?>
Both are connect to third page.