Advertisement
Guest User

Untitled

a guest
Jul 31st, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. <center>
  2. <table border="1" cellpadding="5" cellspacing="0" bordercolor="#000000">
  3. <tr>
  4. <td width="60"><b>IP</b></td>
  5. <td width="100"><b>FQDN</b></td>
  6. <td width="70"><b>OS</b></td>
  7. <td width="150"><b>UpDown</b></td>
  8. <td width="150"><b>Location</b></td>
  9. </tr>
  10. <tr>
  11. <td>
  12. <?php
  13. $hostname = "localhost";
  14. $username = "dennis";
  15. $password = "q1w2e3r4";
  16. $usertable = "chwt1";
  17. $dbName = "chwdb";
  18.  
  19. MYSQL_CONNECT($hostname, $username, $password) OR DIE("DB connection unavailable");
  20. @mysql_select_db( "$dbName") or die( "Unable to select database");
  21. ?>
  22. <?php
  23. //error message (not found message)begins
  24. $XX = "No Record Found, to search again please close this window";
  25. //query details table begins
  26. $sql = "SELECT * FROM details WHERE $metode LIKE '%$search%' LIMIT 0, 50"
  27. $query = mysql_query($sql);
  28. echo "$sql";
  29. while ($row = @mysql_fetch_array($query))
  30. {
  31. $variable1=$row["IP"];
  32. $variable2=$row["FQDN"];
  33. $variable3=$row["OS"];
  34. $variable4=$row["UpDown"];
  35. $variable5=$row["Location"];
  36.  
  37. //table layout for results
  38.  
  39. print ("<tr>");
  40. print ("<td>$variable1</td>");
  41. print ("<td>$variable2</td>");
  42. print ("<td>$variable3</td>");
  43. print ("<td>$variable4</td>");
  44. print ("<td>$variable5</td>");
  45. print ("</tr>");
  46. }
  47. //below this is the function for no record!!
  48. if (!$variable1)
  49. {
  50. print ("$XX");
  51. }
  52. //end
  53. ?>
  54. </table>
  55. </center>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement