jmac2501 Posted November 12, 2009 Share Posted November 12, 2009 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(); } ?> Link to comment https://forums.phpfreaks.com/topic/181293-solved-problem-with-code-working-in-firefox-but-not-ie/ Share on other sites More sharing options...
mrMarcus Posted November 12, 2009 Share Posted November 12, 2009 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. Link to comment https://forums.phpfreaks.com/topic/181293-solved-problem-with-code-working-in-firefox-but-not-ie/#findComment-956399 Share on other sites More sharing options...
jmac2501 Posted November 12, 2009 Author Share Posted November 12, 2009 yep that worked. thanks Link to comment https://forums.phpfreaks.com/topic/181293-solved-problem-with-code-working-in-firefox-but-not-ie/#findComment-956417 Share on other sites More sharing options...
mrMarcus Posted November 12, 2009 Share Posted November 12, 2009 it's funny, i don't come across this problem in ages, and all of a sudden, it comes up twice in as many days. weird. Link to comment https://forums.phpfreaks.com/topic/181293-solved-problem-with-code-working-in-firefox-but-not-ie/#findComment-956426 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.