We include the login.
inc.php file for this. We are including a separate file because the login form will be
needed in the checkout process too. So if we have a separate file, we can use the same
code at both these places.
include("login.inc.php");
?>
Let's s now see the code in login.inc.php.
// If we can find the username / password in the cookie (
// stored on last login), or if the page
// is called again - on a failed login - fill them up automatically
// Ideally, we should clean up and validate these variables
// before using them
$myUsername = ($_COOKIE["potrUsername"] != "")? $_
COOKIE["potrUsername"] : $_POST["username"];
$myPassword = ($_COOKIE["potrPassword"] != "")? $_
COOKIE["potrPassword"] : $_POST["password"];
$returnUrl = isset($_REQUEST["return"]) ? $_REQUEST[
"return"] : $return;
?>
Building Pizza On The Run
[ 56 ]
Login
Login to repeat your last orders and speed up checkout.
We allow saving the username and password in a cookie to automatically populate
fields from the cookie, next time.
Pages:
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91