Jump to content

[SOLVED] problem with code working in firefox but not IE


jmac2501

Recommended Posts

The code below works fine in Fire fox but doesn't work in IE.

it get to this part:

if (isset($_POST['submit_pwd'])){

  $pass = isset($_POST['passwd']) ? $_POST['passwd'] : '';

and goes doesn't prosses any passwork right or wrong.

just goes to the last else.

<?php
require_once 'mySetups.php';

if (isset($_POST['staConfig'])) {
    $thetext=$_POST['staConfig'];
    $page_content = writeStaConfigFile($thetext);
echo $page_content;
sleep(2);
echo '<form action=mydocs.php; method="post" name="cleanStart">';
} 

function showForm($error="<br><br>LINE SUPPORT ADMIN PASSWORD:"){
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "DTD/xhtml1-transitional.dtd">
<html>
<body>
  <?php echo $error; ?>
  <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="pwd">
     <table>
       <tr>
         <td><input name="passwd" type="password"/></td>
       </tr>
       <tr>
         <td align="center"><br/>
          <input type="submit" name="submit_pwd" value="Login"/>
         </td>
       </tr>
     </table>  
   </form>
</body>       
<?php   
}
?> 

<?php
$Password = 'techie11'; // Set password here

if (isset($_POST['submit_pwd'])){
   $pass = isset($_POST['passwd']) ? $_POST['passwd'] : '';
     
   if ($pass != $Password) {
      showForm("Wrong password");
      exit();     
   } else {
      echo "Welcome master of all knowledge.";
      echo '<form method="post" action='.$php_self.'>';
       echo '<input type="hidden" name="staConfig" value="DELL 1603\nDrive Build" >';
       echo '<input type="submit" name="Submit" value="Write to File">';
       echo "</form>";
   }
} else {
   showForm();
   exit();
}
?> 

when you click "Login" instead of just hitting "ENTER", it works, right?

 

change:

 

if (isset ($_POST['submit_pwd']))

 

to:

 

if (isset ($_POST['passwd']))

 

let me know how that goes.

 

alternatively, you can include a hidden <input> within the form, but it's all the same.

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.