loozah Posted February 8, 2010 Share Posted February 8, 2010 I have tried everything I can think of and have had no success with the solutions I have found on forums so far. my problem is that the code below works just fine on FireFox, Chrome and Safari but stops dead on Internet Explorer and Opera... ################################################### this is the "myconfig.php" ################################################### <?php session_start(); mysql_connect("localhost", "mydata", "my_pass") or die(); mysql_select_db("my_database") or die(); function logged_in() { if (isset($_SESSION['username']) || isset($_COOKIE['username'])) { $logged_in = TRUE; return $logged_in; } } ?> ############################################### this is the login/redirect page (input passed from separate login form) ################################################### <?php include "myconfig.php"; if ($_POST['login']) { //get the data $username = stripslashes($_POST['username']); $password = stripslashes($_POST['password']); $rememberme = $_POST['rememberme']; if ($username && $password) { $login = mysql_query("SELECT * FROM mytable WHERE email = '$username'"); while ($row = mysql_fetch_assoc($login)) { $db_pass = $row['password']; if ($pass == $db_pass) $loginok = TRUE; else $loginok = FALSE; if ($loginok == TRUE) { if ($remember_me == "on") setcookie ( $_COOKIE['username'], $username, time()+7200); else if ($remember_me == "") $_SESSION['username']=$username; header("Location: ../admin.php"); exit(); } else die("error msg"); } } else die ("error msg"); } ?> any help would be greatly appreciated by my three remaining hairs Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/191323-this-redirect-dosnt-work-on-ie-or-opera-but-works-fine-on-ff-chrome-safari/ Share on other sites More sharing options...
jskywalker Posted February 8, 2010 Share Posted February 8, 2010 if ($pass == $db_pass) where did you define '$pass'...?? i think this should be '$password' Quote Link to comment https://forums.phpfreaks.com/topic/191323-this-redirect-dosnt-work-on-ie-or-opera-but-works-fine-on-ff-chrome-safari/#findComment-1008728 Share on other sites More sharing options...
loozah Posted February 8, 2010 Author Share Posted February 8, 2010 You're absolutely correct. I did indeed use "password" in my script "pass" in the post is a typo... sorry bout' that Thanks for your response Quote Link to comment https://forums.phpfreaks.com/topic/191323-this-redirect-dosnt-work-on-ie-or-opera-but-works-fine-on-ff-chrome-safari/#findComment-1008732 Share on other sites More sharing options...
PFMaBiSmAd Posted February 8, 2010 Share Posted February 8, 2010 "pass" in the post is a typo... You should be coping/pasting your actual code so that you don't waste everyone's time. Post the form that is submitting the data to that code. You are likely using an image as a submit button and the browsers where your code does function are actually not following the HTML specification in sending the $_POST['login'] value. Quote Link to comment https://forums.phpfreaks.com/topic/191323-this-redirect-dosnt-work-on-ie-or-opera-but-works-fine-on-ff-chrome-safari/#findComment-1008738 Share on other sites More sharing options...
loozah Posted February 8, 2010 Author Share Posted February 8, 2010 Yup! I had an image as a button in the form... all is well now thanks. Bye the way I did copy and paste, the error was due to some changes I had made just before the post and... what can I say? I missed it... anyway thanks again. Quote Link to comment https://forums.phpfreaks.com/topic/191323-this-redirect-dosnt-work-on-ie-or-opera-but-works-fine-on-ff-chrome-safari/#findComment-1008747 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.