Advertisement
Guest User

Untitled

a guest
Oct 14th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5. <h1>Sprawdzanie dostepnosci serwera</h1>
  6. <?php
  7. $servername = "https://bogdan.hostinghouse.pl";
  8. $username = "tinfgrby_artur";
  9. $password = "1234";
  10. $dbname = "tinfgrby_z1v2";
  11.  
  12. echo phpinfo();
  13.  
  14. // Create connection
  15. $conn = new mysqli($servername, $username, $password, $dbname);
  16. // Check connection
  17. if ($conn->connect_error) {
  18.     die("Connection failed: ".$conn->connect_error);
  19. }
  20.  
  21. $sql = "SELECT nazwa, adres_domeny, port, ilosc_prob FROM domeny1";
  22. $result = $conn->query($sql);
  23.  
  24. if ($result->num_rows > 0) {
  25.     echo "<table border='1'>
  26.                 <tr>
  27.                     <th>Nazwa hosta</th>
  28.                     <th>Domena hosta</th>
  29.                    <th>Port</th>
  30.                     <th>Ping</th>
  31.                 </tr>";
  32.     // output data of each row
  33.     while($row = $result->fetch_assoc()) {
  34.         echo  "<tr>
  35. <td>".$row["nazwa"]."</td>
  36. <td>".$row["adres_domeny"]."</td>
  37. <td>".$row["port"]."</td>
  38. <td>".$row["ilosc_prob"]."</td>
  39. </tr>";
  40.     }
  41.     echo "</table>";
  42.     } else {
  43.     echo "0 results";
  44. }
  45. $conn->close();
  46. ?>
  47.  
  48. </body>
  49. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement