Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1- form login
- <?php
- $username = $_POST['username'];
- $password = $_POST['password'];
- $error ='';
- $sucess ='';
- if(isset($_POST['submit'])){
- if($username =='admin'){
- if($password == '123'){
- $error = " ";
- $sucess = "welcome";
- }else{
- $error = "invalid password";
- $sucess = " ";
- }
- }else{
- $error = "invalid username";
- $sucess = " ";
- }
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Get Your Hands Dirty: <!-- PAGE TITLE --></title>
- <link href="../assets/styles.css" rel="stylesheet">
- <style>
- .error{color:red;}
- .sucess{color:green;}
- </style>
- </head>
- <body>
- <div class="wrapper">
- <a href="/" title="Back to directory" id="logo">
- <img src="../assets/img/logo.png" alt="PHP">
- </a>
- <h1>Get Your Hands Dirty: <small><!-- PAGE TITLE --></small></h1>
- <hr>
- <h2>Your Example</h2>
- <form name="cookieform" id="login" method="POST">
- <p class="error"><?php echo $error ;?></p>
- <p class="sucess"><?php echo $sucess; ?></p>
- <label for="username">User Name</label>
- <input type="text" name="username" id="username" class="text" maxlength="30" required />
- <label for="password">Password</label>
- <input type="text" name="password" id="password" class="text" maxlength="30" required />
- <input type="submit" name="submit" value="login">
- </form>
- <small>©<!-- THIS YEAR --> - <!-- YOUR NAME --></small>
- </div><!-- end wrapper -->
- <div class="copyright-info">
- <?php include('../assets/includes/copyright.php'); ?>
- </div><!-- end copyright-info -->
- </body>
- </html>
Add Comment
Please, Sign In to add comment