ccrevcypsys Posted November 2, 2007 Share Posted November 2, 2007 Hello i dont know weather this would fall into this or the mysql table but heres the problem. Ok so i have 2 tables on my website. One for all the customers and one for all the artists. Now im trying to make it to where if you log in as an artist then it loads the artist portion of the website and the opposite for the customers. Now this is the error i get and following that is the code for where this error stems from. The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete. * This problem can sometimes be caused by disabling or refusing to accept cookies. <?php //Here is the code for the login.inc.php page if($_GET['act']=="login" && isset($_POST['username']) && isset($_POST['password'])){ $_POST['username'] = treatGet($_POST['username']); $_POST['password'] = treatGet($_POST['password']); $query = "SELECT ".$glob['dbprefix']."customer.customer_id, ".$glob['dbprefix']."customer.customer_id FROM ".$glob['dbprefix']."customer LEFT JOIN ".$glob['dbprefix']."artists on ".$glob['dbprefix']."artists.customer_id=".$glob['dbprefix']."customer.customer_id WHERE (".$glob['dbprefix']."customer.email=".$db->mySQLSafe($_POST['username'])." AND ".$glob['dbprefix']."customer.password = ".$db->mySQLSafe(md5($_POST['password']))." AND ".$glob['dbprefix']."customer.type>0) OR (".$glob['dbprefix']."artists.email=".$db->mySQLSafe($_POST['username'])." AND ".$glob['dbprefix']."artists.password = ".$db->mySQLSafe(md5($_POST['password']))." AND ".$glob['dbprefix']."artists.type>0)"; $customer = $db->select($query); if($customer==FALSE) { if($db->blocker($_POST['username'],$ini['bfattempts'],$ini['bftime'],FALSE,"f")==TRUE) { $blocked = TRUE; } } elseif($customer[0]['customer_id']>0) { if($db->blocker($_POST['username'],$ini['bfattempts'],$ini['bftime'],TRUE,"f")==TRUE) { $blocked = TRUE; } else { $customerData["customer_id"] = $customer[0]['customer_id']; $update = $db->update($glob['dbprefix']."sessions", $customerData,"sessId=".$db->mySQLSafe($_SESSION['ccUser'])); // redirect // "login","reg","unsubscribe","forgotPass" if(isset($_GET['redir']) && !empty($_GET['redir']) && !eregi("logout|login|forgotPass|changePass",base64_decode($_GET['redir']))){ header("Location: ".str_replace("amp;","",treatGet(base64_decode($_GET['redir'])))); exit; } else { header("Location: index.php"); exit; } } } elseif(eregi("step1",base64_decode($_GET['redir']))) { header("Location: ".$GLOBALS['rootRel']."cart.php?act=step1"); exit; } } //Here is the code on the session.inc.php $query = "SELECT * FROM ".$glob['dbprefix']."sessions LEFT JOIN ".$glob['dbprefix']."customer ON ".$glob['dbprefix']."sessions.customer_id = ".$glob['dbprefix']."customer.customer_id JOIN ".$glob['dbprefix']."artists ON ".$glob['dbprefix']."sessions.customer_id = ".$glob['dbprefix']."artists.customer_id WHERE sessId = ".$db->mySQLSafe($_SESSION['ccUser']); $ccUserData = $db->select($query); // We have a session issue :-/ (e.g. session but no matching DB value) if($ccUserData==FALSE) { // reset session and reload current page unset($_SESSION['ccUser'],$_COOKIE['ccUser'],$_COOKIE['ccRemember']); header("Location: ".str_replace("&","&",currentPage())); exit; } ?> So what does it look like the problem is... Quote Link to comment https://forums.phpfreaks.com/topic/75834-help-with-sessions/ Share on other sites More sharing options...
marcus Posted November 2, 2007 Share Posted November 2, 2007 It's not usually the best to use session and cookies at the same time. Also, the only real way to end a cookie is to set the expiration time back from where it started. Quote Link to comment https://forums.phpfreaks.com/topic/75834-help-with-sessions/#findComment-383821 Share on other sites More sharing options...
ccrevcypsys Posted November 2, 2007 Author Share Posted November 2, 2007 It's not usually the best to use session and cookies at the same time. Also, the only real way to end a cookie is to set the expiration time back from where it started. so what do u suggest that i try? Quote Link to comment https://forums.phpfreaks.com/topic/75834-help-with-sessions/#findComment-383824 Share on other sites More sharing options...
marcus Posted November 2, 2007 Share Posted November 2, 2007 You can just store every value in either session, or cookies. Quote Link to comment https://forums.phpfreaks.com/topic/75834-help-with-sessions/#findComment-383826 Share on other sites More sharing options...
ccrevcypsys Posted November 2, 2007 Author Share Posted November 2, 2007 so like get rid of all of the cookie info on the login and session pages? i am new to sessions i just started working on them... Quote Link to comment https://forums.phpfreaks.com/topic/75834-help-with-sessions/#findComment-383831 Share on other sites More sharing options...
revraz Posted November 2, 2007 Share Posted November 2, 2007 Try to write a Cookie, if it fails, use a Session. so what do u suggest that i try? Quote Link to comment https://forums.phpfreaks.com/topic/75834-help-with-sessions/#findComment-383833 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.