Veirdo Posted March 3, 2004 Posted March 3, 2004 Hey all... been working on a osCo site for a while and it is almost ready! Love this cart. I need some help checking if a user is registered or not, regardless of whether they are logged on or not. Here's some code I almost have working: ////////////////// USER AUTHENTICATION/REGISTRATION PLACEHOLDER ///////////////// //This is where you will add a username/password check against your local database or //.htaccess file, such as: $user_id=$HTTP_GET_VARS['Username']; $password=$HTTP_GET_VARS['Password']; $query = "SELECT COUNT(customers_email_address) FROM customers WHERE customers_email_address='$user_id' AND customers_password='$password'"; $results = mysql_query($query); $isUser = mysql_num_rows($results); if ($isUser != 1){ header("Location: Console.html?errorMessage=Invalid username or password"); exit(); } //If the user is authenticated, it will continue processing the code below. Otherwise the //user is given an error message and/or redirected to the login page to try again. /////////// END OF USER AUTHENTICATION/REGISTRATION PLACEHOLDER /////////////////// I'm stuck at this point, does anyone see my error? Thanks a billion. I also have an .htpasswd file that I would like to check for user/pass as well. Is this possible???
Veirdo Posted March 3, 2004 Author Posted March 3, 2004 Forgot to mention, of course before the Authentication routine, I have require('http://www.websitename.com/includes/application_top.php');
Guest Posted March 4, 2004 Posted March 4, 2004 You only need: <?php require('includes/application_top.php'); if (tep_session_is_registered('customer_id')) { // YOUR_CODE } <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> ?> Matti
vincenzonardone Posted May 13, 2004 Posted May 13, 2004 how would i check if they had under 5 items at the same time? cos this don't work... if ($cart->count_contents() < 5) && (tep_session_is_registered('customer_id') { // MY CODE } Vincenzo Nardone
vincenzonardone Posted May 13, 2004 Posted May 13, 2004 or this... if ( ($cart->count_contents() < 5) AND (tep_session_is_registered('customer_id') ) { // MY CODE } Vincenzo Nardone
Recommended Posts
Archived
This topic is now archived and is closed to further replies.