Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. <?php
  2. // Setup database information
  3. $db_location = "localhost";
  4. $db_name = "";
  5. $db_username = "";
  6. $db_password = "";
  7. $table_name = "tblhosting";
  8.  
  9. mysql_connect($db_location,$db_username,$db_password);
  10. @mysql_select_db($db_name);
  11.  
  12. $result = mysql_query("SELECT * FROM ".$table_name."");
  13. while($row = mysql_fetch_array($result))
  14. {
  15. ++$data['total']; //gets all accounts registered
  16.  
  17. if($row['domainstatus']=="Active")
  18. ++$data['active']; //gets all active accounts
  19.  
  20. if($row['regdate']==date("Y-m-d", time()-(60*60*24)))
  21. ++$data['yesterday']; //gets accounts created yesterday
  22.  
  23. if(
  24. $row['regdate']==date("Y-m-d", time()-(60*60*24)) || //yesterday
  25. $row['regdate']==date("Y-m-d", time()-(2*60*60*24)) || //2 days ago...
  26. $row['regdate']==date("Y-m-d", time()-(3*60*60*24)) ||
  27. $row['regdate']==date('Y-m-d', time()-(4*60*60*24)) ||
  28. $row['regdate']==date('Y-m-d', time()-(5*60*60*24)) ||
  29. $row['regdate']==date('Y-m-d', time()-(6*60*60*24)) ||
  30. $row['regdate']==date('Y-m-d', time()-(7*60*60*24))
  31. )
  32. ++$data['last7'];
  33. }
  34. /*
  35. foreach($data as $key=>$val)
  36. {
  37. if($key=="total")
  38. echo "Total Accounts";
  39.  
  40. if($key=="active")
  41. echo "Active Accounts";
  42.  
  43. if($key=="yesterday")
  44. echo "Accounts Made Yesterday";
  45.  
  46. if($key=="last7")
  47. echo "Accounts Made Within Last 7 Days";
  48.  
  49. echo ": ".$val."<br />"
  50. }
  51. */
  52.  
  53. $ran[] = $data['total']." webmasters use Web-Hosting-Service.org to host their websites!";
  54. $ran[] = "Web-Hosting-Service.org currently has ".$data['active']." active hosting accounts.";
  55. $ran[] = "Web-Hosting-Service.org has opened ".$data['last7']." new accounts this week. ";
  56. $ran[] = "Yesterday a total of ".$data['yesterday']." accounts were opened at Web-Hosting-Service.org!";
  57.  
  58. $max = count($ran)-1;
  59. $min = 0;
  60. $bla = rand($min,$max);
  61. echo $ran[$bla];
  62.  
  63. echo mysql_error();
  64. // close DB after the website loads
  65. mysql_close();
  66. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement