Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <!-- file1 : login-combined.php -->
- <html>
- <body>
- <h2>Login form</h2>
- <form action=""
- method="get">
- Username *<br>
- <input type="text"
- name="username" ><br>
- Password *<br>
- <input type="password"
- name="password" ><br><br>
- <input type="submit" value="Login">
- </form>
- <hr>
- <?php
- // php.net/isset
- //FETCH both input
- if (isset($_GET['username'])){
- $username=$_GET['username'];
- $password=$_GET['password'];
- //check the content
- if($username==null){
- //username blank
- echo "Do provide your username<br>";
- }
- else if($password==null){
- //password blank
- echo "Do provide your password<br>";
- }
- else {
- //do db comparison
- //DISPLAY all input value
- echo "Your username
- is $username <br>";
- echo "Your dummy password
- is ****** <br>";
- }
- }//isset
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment