s4vi0r Posted March 1, 2011 Share Posted March 1, 2011 Hey everyone, I haven't been working with php long and that my be the root of the problem here but your help is very appreciated. Here is the problem: I have created a login system for a website everything seems to be working great in Chrome and FF. However IE8 is giving some problems. It acts as if my $username and $password variables don't get set. However, I have tried using echo and they print out just fine. I have tried rearranging my code and checking the variables with inset() ...nothing I try seems to work. Maybe I'm doing something wrong you guys can help with. Thanks. (Code below) <?php session_start(); // Connect to database code here (left out for obvious reasons) ****** ****** //get user name and password before we try and connect $username = $_POST['username']; $password = $_POST['password']; //if username and password suck go back to login screen otherwise check against database. if(!$username && !$password) { header( 'refresh: 2; url=login.html' ); die("username and password could not be verified"); } else { ////here is where i would check database =p } ....... Quote Link to comment Share on other sites More sharing options...
mhodge_txs Posted March 3, 2011 Share Posted March 3, 2011 What happens if you do a var_dump of username and password across all the browsers then at least you can see if they are being set. It does not make sense that it would be doing what you claim its doing given the code that you have supplied. Quote Link to comment Share on other sites More sharing options...
Muddy_Funster Posted March 3, 2011 Share Posted March 3, 2011 could you post your form up please? also, have you used the w3c validator on your pages? - if there are any browser specific issues that generaly tells you what they are. Quote Link to comment Share on other sites More sharing options...
s4vi0r Posted March 3, 2011 Author Share Posted March 3, 2011 Figured it out. Later in the code if information checked out I directed the user to another page using header() function. It looked like this: $products = $username."/userProducts.html"; header( "refresh: 3; '$products'" ); It should have looked like this: $products = $username."/userProducts.html"; header( "refresh: 3; url='$products'" ); Forgot the "url=" So what ended up happening is for some reason it refreshed the page it was on and didn't resubmit the form data that caused the problem. Funny that it only happened in IE, really stressed over this one. Probably should have used Location: here anyhow, oh well. Figured this out by submitting the values through the url like: URL?username=blah&password=blah this caused the page to refresh over and over..and I was like wt heck, so I was able to figure out what was going on. Problem solved. Thanks for the help. Quote Link to comment 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.