Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <form name="empInfo" method="post" enctype="multipart/form-data" align="center" action="">
- Host Employee ID: <input type="text" name="id"><br>
- <input type="submit" value="Click here to fill host info" name="submit"><br>
- </form>
- <?php
- if(isset($_POST["submit"])) {
- $id= $_POST['id'];
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "test";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql="SELECT * FROM `users` WHERE `ID`= '$id'";
- $result=mysqli_query($conn,$sql);
- $row= mysqli_fetch_assoc($result);
- echo $row['ID'];
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement