Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Show Error Message</title>
- </head>
- <body>
- <table cellspacing=3 cellpadding=3>
- <form action="" method="post">
- <tr><td>Username:</td><td><input type="text" name="input1" size=20></td></tr>
- <tr><td>Password:</td><td><input type="password" name="input2" size=20></td></tr>
- <tr><td> </td><td><input type="submit" name="submit" value="Login!"></td></tr>
- </form>
- </table>
- </body>
- </html>
- <?php
- if(isset($_POST['submit'])){
- $error_msg="";
- $input1=$_POST['input1'];
- $input2=$_POST['input2'];
- if($input1==""){
- $error_msg .= "You need to enter username";
- }
- else {
- $error_msg="Username is Filled!";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement