Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php include "dbConfig.php";
- $msg = "";
- if (isset($_POST['user']) and isset($_POST['pass'])) {
- $name = $_POST["user"];
- $pass = $_POST["pass"];
- $sql = "SELECT * FROM tblUser WHERE struserCode = '$name' AND strUserPass = '$pass'";
- $query = mysql_query($sql) or die(mysql_error());
- $count = mysql_num_rows($query);
- if ($name == '' || $password == '') {
- $msg = "You must enter all fields";
- }
- else {
- if ($count == 1){
- $_SESSION['struserCode'] = $username;
- header('Location: boot.php');
- }
- else {
- echo "Invalid Login Credentials.";
- }
- }
- }
- $msg = "Username and password do not match";
- ?>
- $username = "root";
- $password = "";
- $hostname = "localhost";
- $output = '';
- //connection to the database
- $dbhandle = mysql_connect($hostname, $username, $password)
- or die("Unable to connect to MySQL");
- $selected = mysql_select_db("homework",$dbhandle)
- or die("Could not select examples");
- <button type="submit" class="submit" name = "submit" action = "boot.php">>> </button>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement