Jump to content

my php code doesnt work in internet explorer!!!


silverglade

Recommended Posts

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>";
    }

?> 

        // 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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.