Guest User

Untitled

a guest
May 30th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. <?php
  2.  
  3. $servername = "localhost";
  4. $username = "root";
  5. $password = "";
  6. $dbname = "class";
  7.  
  8. // Create connection
  9. $conn = new mysqli($servername, $username, $password, $dbname);
  10. // Check connection
  11. if ($conn->connect_error) {
  12. die("Connection failed: " . $conn->connect_error);
  13. }
  14.  
  15. $sql = "SELECT ctracking, cname, cemail, crport, cdport, clocation, cdestination FROM demo";
  16. $result = $conn->query($sql);
  17.  
  18. if ($result->num_rows > 0) {
  19. // output data of each row
  20. while($row = $result->fetch_assoc()) {
  21. echo "ctracking: " . $row["ctracking"]. " - Name: " . $row["cname"]. " - Email: " . $row["cemail"]. " - Port: " . $row["crport"]. " - Dport: " . $row["cdport"]." - Location: " . $row["clocation"]. " - Destination: " . $row["cdestination"]. "<br>";
  22. }
  23. } else {
  24. echo "0 results";
  25. }
  26. $conn->close();
  27.  
  28. ?>
  29.  
  30. <html>
  31. <head>
  32. <title> Static Page</title>
  33. </head>
  34.  
  35. <body>
  36. <form action="making.php" method="post" />
  37. <h1>Britchi Tracking</h1>
  38. <p>
  39. Costumers Name (required) <br/>
  40. <input type="text" name="search" placeholder="Emmanuel John"' . '" size="70"/>
  41. </p>
  42. <p><input type="submit" name="csearch" value="Search"></p>
  43. </form>
  44.  
  45. <form action="http://localhost/wordpress">
  46. <input type="submit" value="Go to Home Page">
  47. </form
  48. </body>
  49.  
  50. </html>
Add Comment
Please, Sign In to add comment