Jump to content

creating a password


knight47

Recommended Posts

What the hell is wrong with this code? it won't work! it keeps saying "nope!"  this is the same code I used [URL=http://"http://knight47.com/php_scripts/pass.html"]here[/URL], that works, but this doesn't! i'm going insane!

[code=php:0]<?php
if ($_POST['Submit'] AND $_POST['pass'] == "ilovelambs")
{
echo "welcome to the password protected page";
}
else
{
echo "nope!";
}
?>[/code]

html code:
<div align="center">
  <p>password: </p>
  <form action="pass.php" method="post" name="pass" id="pass">
    <label>
      <input type="password" name="textfield">
    </label>
    <p>
      <label>
      <input type="submit" name="Submit" value="Submit">
      </label>
    </p>
  </form>
  <p>&nbsp;</p>
</div>


WHY IS IT NOT WORKING! THERE IS NOTHING WRONG!
Link to comment
https://forums.phpfreaks.com/topic/32362-creating-a-password/
Share on other sites

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.