Guest User

Untitled

a guest
Nov 5th, 2017
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
  8. <meta name="description" content="">
  9. <meta name="author" content="">
  10.  
  11. <!-- Bootstrap CDN CSS -->
  12. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
  13.  
  14. </head>
  15.  
  16. <body>
  17. <div class="container">
  18. <h1>Wordpress Landing Page</h1>
  19. <br>
  20. <h4>Initial Setup Instructions:<h4>
  21. <div class="jumbotron">
  22. <u>If your wordpress page is not setup please follow the instructions below:</u><br>
  23. <ol>
  24. <li>Fill in the setup page</li>
  25. <li><b>Important:</b> Make sure you write down your password or make it simple</li>
  26. </ol>
  27. </div>
  28. <br>
  29. <h4>Individual User Links:</h4>
  30. <br>
  31.  
  32.  
  33. <?php
  34.  
  35. /** Build Page **/
  36.  
  37. /** Mysql Login Credentials **/
  38. $hostname = '127.0.0.1';
  39. $username = 'root';
  40. $password = 'password';
  41. $charset='utf8';
  42.  
  43. /** Setup Connection String **/
  44. $dsn = "mysql:host=$hostname;charset=$charset";
  45.  
  46. /** Define Setup Parameters **/
  47. $opt = [
  48. PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
  49. PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
  50. PDO::ATTR_EMULATE_PREPARES => false,
  51. ];
  52.  
  53. /** Connect **/
  54. $pdo = new PDO($dsn, $username, $password, $opt);
  55.  
  56. /** Setup Column Info **/
  57. $count = 0;
  58. $first_row = true;
  59.  
  60. /** Get Existing Databases **/
  61. $pdo_query = $pdo->query('SHOW DATABASES');
  62. while(($db = $pdo_query->fetchColumn(0)) !== false){
  63. if($db != 'information_schema' || $db != 'mysql' || $db != 'performance_schema'){
  64.  
  65. if($count == 3){ /** If End Of Row Reset Count **/
  66. $count = 0;
  67. }
  68.  
  69. /** If New Row Create Row **/
  70. if($count == 0){
  71. if($first_row === true){
  72. echo '<div class="row">'.PHP_EOL;
  73. $first_row = false;
  74. }else{
  75. echo '</div>'.PHP_EOL;
  76. echo '<br>'.PHP_EOL;
  77. echo '<div class="row">'.PHP_EOL;
  78. }
  79. }
  80.  
  81. /** Add Navigation Button **/
  82. echo '<div class="col-md-4">'.PHP_EOL;
  83. echo '<span>'.PHP_EOL;
  84. echo '<a href="/wordpress/'.$db.'" class="btn btn-primary btn-lg">'.$db.' Main Site</a>'.PHP_EOL;
  85. echo '<a href="/wordpress/'.$db.'/wp-admin" class="btn btn-warning btn-lg">'.$db.' Login Page</a>'.PHP_EOL;
  86. echo '</span>'.PHP_EOL;
  87. echo '</div>'.PHP_EOL;
  88. $count++;
  89. }
  90. }
  91.  
  92. /** End Columns **/
  93. echo '</div>'.PHP_EOL;
  94.  
  95.  
  96.  
  97. ?>
  98. </div>
  99. </body>
  100. </html>
Add Comment
Please, Sign In to add comment