Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Name: Justin Frye
- Project: Create an online bookstore
- Purpose: Stores createAccount into database
- Course: CSC 242-010 - Spring 2016
- Date: April 14, 2016
- Due Date: April 18, 2016
- */
- //DATABASE CONNECTION
- //define parameters
- $DB_HOST='localhost';
- $DB_USER='jfrye031';
- $DB_PASS='q5tavacA';
- $DB_NAME='bookstore_jfrye031';
- //connect to the database
- $db = new mysqli($DB_HOST, $DB_USER, $DB_PASS, $DB_NAME);
- //END DATABASE CONNECTION
- $email = $_POST['Email'];
- $password = $_POST['Passwd'];
- //attempts to login with the given email & password
- $q = mysql_query("select * from Customer where Email='email' and Passwd='password'")
- or die(mysql_error());
- $res = mysql_fetch_row($q);
- if($res)
- {
- header('location:websiteHome.php');
- }//end if
- else
- {
- echo 'Invalid Email and/or Password. Please try again';
- }//end else
- //close the database
- $db->close();
- ?>
- <html>
- <head><title> Checking the login.. </title>
- </head>
- <body>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement