Advertisement
Guest User

Untitled

a guest
Jun 29th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.21 KB | None | 0 0
  1. <?php
  2. session_start();
  3. if (!isset($_SESSION['count'])) {
  4.   $_SESSION['count'] = 0;
  5. } else {
  6.   $_SESSION['count']++;
  7. }
  8.  
  9. echo "This page has refreshed: ".$_SESSION['count']." times.<br>";
  10.  
  11. $svname = "185.38.148.82";
  12. $username = "zeniwork_hyper";
  13. $password = "Ou5BzsvF6H3A";
  14. $dbname = "zeniwork_tinytown";
  15.  
  16. $tableRefresh = 0;
  17.  
  18. $con = mysqli_connect( $svname, $username, $password, $dbname );
  19.  
  20. if (!$con) {
  21.   die( "Connection failed due to: " . mysqli_connect_error());
  22. }
  23. echo "Connected to database! <br>";
  24.  
  25. echo "<table>";
  26. echo "<tr><th>ID</th><th>Name</th><th>Value</th></tr>";
  27.  
  28. $rtMarket = "SELECT * FROM test";
  29. $rtResult = mysqli_query($con, $rtMarket);
  30.  
  31. while($row = mysqli_fetch_assoc($rtResult)) {
  32.   $id = $row["ID"];
  33.   $name = $row["name"];
  34.   $value = $row["value"];
  35.   echo "<tr><td>".$id."</td><td>".$name."</td><td>".$value."</td></tr>";
  36. }
  37.  
  38. echo "</table>";
  39.  
  40. ?>
  41.  
  42. <!DOCTYPE html>
  43. <html>
  44.   <head>
  45.     <title>Example PHP</title>
  46.     <link href="main.css" rel="stylesheet" type="text/css">
  47.     <meta charset="utf-8">
  48.     <meta http-equiv="refresh" content="10">
  49.     <script>
  50.  
  51.     </script>
  52.   </head>
  53.  
  54.   <body>
  55.     <div class="main-container">
  56.  
  57.     </div>
  58.   </body>
  59. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement