index.php: <html> <body> <form action="login.php" method="post"> <input type="password" name="password" value="password"> <input type="submit" value="Enter Website"> </form> </body> </html> Code (markup): login.php: <html> <body> <?php if($_POST['password'] == yourpassword) { echo "Thanks, your password was entered correctly!"; } else { echo "You have entered an incorrect password!"; } ?> </body> </html> Code (markup): Very simple, I guess no cookies = bad but whatever, I'm a newby at PHP. >.< So when you enter "yourpassword" in the box, you get the + message
Yep... Its just seeing if that statment is true, not creating a new string. Test it out, I'll make a new live demo for you guys to see of this in action.
That same exact script, live: http://pbfrog.com/password Just type "yourpassword" and it will show the + message. Type anything else, and it will show the - message.
Next time code a database driven login with registration. That'll be much more useful experience for you.