silverglade Posted January 27, 2010 Share Posted January 27, 2010 god, i spent all day making this code and it doesnt work in internet explorer 6 ( i use 6 to test my code in case people havent upgraded) here is the code, ANY help greatly appreciated!! <?php include("connect1.php"); ini_set('display_errors', 1); error_reporting(E_ALL); // GREAT SNIPPET FOR DEBUGGING OUTPUTS ERRORS TO SCREEN */ if (isset($_POST['email']) && isset($_POST['Password']) && isset($_POST['Confirm'])) { // Declare Variables $email = mysql_real_escape_string($_POST['email']); $Password = mysql_real_escape_string($_POST['Password']); $Confirm = mysql_real_escape_string($_POST['Confirm']); // Encrypt passwords with md5 encryption $Password = md5($Password); $Confirm = md5($Confirm); if($Password != $Confirm) { echo "<br>The two passwords did not match<br>"; echo "Please enter your email: <form action=\" \" method=\"POST\"> <input type=\email\" name=\"email\"><br> <br> <br><br><br>Please enter your new password:<br> <input type=\"password\" name=\"Password\"><br> <br> Please Confirm that Password:<br> <input type=\"password\" name=\"Confirm\"><br> <br><input type=\"submit\" value=\"Set Password\"</form>"; exit; } // Check if the email already exists in database $query = "SELECT * FROM members WHERE Email = '$email' "; $results = mysql_num_rows(mysql_query($query)); if ($results > 0) { // Insert information to the database mysql_query("UPDATE members SET Password='$Password' WHERE Email='$email'"); //Send them to login header("Location:success.html"); } else { echo "<br>That email does not exist in the database<br>"; } } else { // Displaying Forms echo "Please enter your email: <form action=\" \" method=\"POST\"> <input type=\"text\" name=\"email\"><br> <br> <br><br>Please enter your password:<br> <input type=\"password\" name=\"Password\"><br> <br> Please Confirm that Password:<br> <input type=\"password\" name=\"Confirm\"><br> <br><input type=\"submit\" value=\"Set Password\"></form>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/189958-my-php-code-doesnt-work-in-internet-explorer/ Share on other sites More sharing options...
silverglade Posted January 27, 2010 Author Share Posted January 27, 2010 when you press the submit button it takes you to my homepage, which is not the correct page, it should either reload the page or take you to success.html. Quote Link to comment https://forums.phpfreaks.com/topic/189958-my-php-code-doesnt-work-in-internet-explorer/#findComment-1002267 Share on other sites More sharing options...
oni-kun Posted January 27, 2010 Share Posted January 27, 2010 // Encrypt passwords with md5 encryption MD5 is a hashing method, and is one way nothing like an encryption. It can never, never be unhashed. Your error lies here: <form action=\" \" Your action is nothing. How will IE know where to send the POST data? To the homepage? Set it as $_SERVER['PHP_SELF'] or to your processing page. Quote Link to comment https://forums.phpfreaks.com/topic/189958-my-php-code-doesnt-work-in-internet-explorer/#findComment-1002269 Share on other sites More sharing options...
silverglade Posted January 27, 2010 Author Share Posted January 27, 2010 AWESOME thank you so much. now i can go to bed in a few minutes. you are awesome!!! thanks, derek <form action=\"passrecovery7.php\" Quote Link to comment https://forums.phpfreaks.com/topic/189958-my-php-code-doesnt-work-in-internet-explorer/#findComment-1002271 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.