Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!Doctype html>
- <html>
- </html>
- <head>
- <title>Hello</title>
- </head>
- <body>
- Connection to DB
- <?php
- $serverName = 'localhost';
- $userName ='root';
- $password = '';
- $databaseName = 'session-3';
- $connection = new mysqli($serverName, $userName , $password , $databaseName);
- if($connection->connect_error){
- die ("connection failed: " . $connection->connect_error);
- }
- echo "success <br/>";
- $emaill = $_POST['email'] ;
- $sql ="Select * From users Where Email = '$emaill' ";
- $result = $connection ->query($sql);
- if($result->num_rows > 0){
- while($row = $result->fetch_assoc()){
- echo "ID: ".$row["ID"]. "-Email: ".$row["Email"] . "-Password : ".$row["Password"] . "<br/>";
- }
- }
- else{
- echo " 0 results" ;
- }
- $connection -> close();
- ?>
- <form method="POST" action="welcome.php">
- Email: <input type="text" name="email">
- <!-- Password: <input type="password" name="password">
- -->
- <input type="submit" name="Login">
- </form>
- </body>
- <html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement