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

?> 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.