eemployment-h100
ee_logo_90
Index of the Handbook Index of the Lesson First Page Previous Page Next Page Last Page Objectives of the Lesson Download Questions Bibliography of the Lesson Knowledge Consolidation Page Assistent
Movie Quizzes of the Lesson 50
9 / zyxxyz en-language

2. Simple eCommerce website application

if(isset($_POST['submit'])) {   /*check  if submit button pressed */

if(!$_POST['username'])         /* check if username field is empty */

die("Error: You must enter your <font color='red'><b>username</b></font> before logging in.

<a href=\"login.php\">Try again </a>");

 

if(!$_POST['password'])         /* check if password field is empty */

die("Error: You must enter your <font color='red'><b>password</b></font> before logging in.

<a href=\"login.php\">Try again</a>");

/* verify if user is recorded in our database and if the password entered is identically with that from our database... */

$get_user = mysql_query("SELECT * FROM `members` WHERE username = '".$_POST['username']."' AND password = '".md5($_POST['password'])."'");   /* calculates the md5 hash of the password and returns the hash which is a 32 character hexadecimal number */


Index of the Handbook Index of the Lesson First Page Previous Page Next Page Last Page Objectives of the Lesson Download Questions Bibliography of the Lesson Knowledge Consolidation Page Assistent Movie Quizzes of the Lesson
This project has been funded with the support of the European Community. The contect of this project does not necessarily reflect the position of the European Community or the National Agency, nor does it involve any responsability on their part.