Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
- <meta name="description" content="">
- <meta name="author" content="">
- <!-- Bootstrap CDN CSS -->
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
- </head>
- <body>
- <div class="container">
- <h1>Wordpress Landing Page</h1>
- <br>
- <h4>Initial Setup Instructions:<h4>
- <div class="jumbotron">
- <u>If your wordpress page is not setup please follow the instructions below:</u><br>
- <ol>
- <li>Fill in the setup page</li>
- <li><b>Important:</b> Make sure you write down your password or make it simple</li>
- </ol>
- </div>
- <br>
- <h4>Individual User Links:</h4>
- <br>
- <?php
- /** Build Page **/
- /** Mysql Login Credentials **/
- $hostname = '127.0.0.1';
- $username = 'root';
- $password = 'password';
- $charset='utf8';
- /** Setup Connection String **/
- $dsn = "mysql:host=$hostname;charset=$charset";
- /** Define Setup Parameters **/
- $opt = [
- PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
- PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
- PDO::ATTR_EMULATE_PREPARES => false,
- ];
- /** Connect **/
- $pdo = new PDO($dsn, $username, $password, $opt);
- /** Setup Column Info **/
- $count = 0;
- $first_row = true;
- /** Get Existing Databases **/
- $pdo_query = $pdo->query('SHOW DATABASES');
- while(($db = $pdo_query->fetchColumn(0)) !== false){
- if($db != 'information_schema' || $db != 'mysql' || $db != 'performance_schema'){
- if($count == 3){ /** If End Of Row Reset Count **/
- $count = 0;
- }
- /** If New Row Create Row **/
- if($count == 0){
- if($first_row === true){
- echo '<div class="row">'.PHP_EOL;
- $first_row = false;
- }else{
- echo '</div>'.PHP_EOL;
- echo '<br>'.PHP_EOL;
- echo '<div class="row">'.PHP_EOL;
- }
- }
- /** Add Navigation Button **/
- echo '<div class="col-md-4">'.PHP_EOL;
- echo '<span>'.PHP_EOL;
- echo '<a href="/wordpress/'.$db.'" class="btn btn-primary btn-lg">'.$db.' Main Site</a>'.PHP_EOL;
- echo '<a href="/wordpress/'.$db.'/wp-admin" class="btn btn-warning btn-lg">'.$db.' Login Page</a>'.PHP_EOL;
- echo '</span>'.PHP_EOL;
- echo '</div>'.PHP_EOL;
- $count++;
- }
- }
- /** End Columns **/
- echo '</div>'.PHP_EOL;
- ?>
- </div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment