Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>Login page</title>
- </head>
- <body>
- <center><h3>Enter your credentials</h3></center>
- <form name="Form1" method="post" action="dashboard.php">
- Username: <input type="text" name="username" />
- Password: <input type="text" name="password" />
- <br/>DB Name: <input type="text" name="dbname" />
- <input type="submit" name="submit" />
- </form>
- <?php
- define ("DB_name",$_POST["dbname"],true);
- $DB_name = $_POST["dbname"];
- $DB_user = $_POST["username"];
- $DB_password = $_POST["password"];
- mysql_connect("localhost", "root", "ONGOINGwarfare1+2+3+");
- mysql_query("CREATE DATABASE $DB_name");
- mysql_query("CREATE USER $DB_user IDENTIFIED by '$DB_password'");
- mysql_query("GRANT all privileges ON $DB_name.* to '$DB_user'@'localhost' IDENTIFIED by '$DB_password'");
- print "$DB_name was successfully created, now you can log into your database on Hive696 using the following line: <br>
- \"mysql -u$DB_user -p$DB_password;\"";
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement