Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- // Config vars
- include("../config/config.php");
- // Variables
- $register = $_POST["Submit"];
- $user = $_POST["Username"];
- $pass = $_POST["Password"];
- $repass = $_POST["RepeatPassword"];
- $email = $_POST["Email"];
- $page = [
- '
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Wizguin - Register</title>
- <link rel="shortcut icon" href="assets/favicon-magic.ico">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" media="screen">
- <link rel="stylesheet" href="fontawesome/css/font-awesome.min.css">
- <link rel="stylesheet" href="css/hover-min.css">
- <link rel="stylesheet" href="css/styles.css">
- <link rel="stylesheet" href="css/register.css">
- </head>
- <body>
- <div class="navbar navbar-default">
- <div class="container">
- <div class="navbar-header">
- <a class="navbar-brand">Wizguin</a>
- <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#navbar-main">
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
- </div>
- <div class="navbar-collapse collapse" id="navbar-main">
- <ul class="nav navbar-nav navbar-right">
- <li>
- <a href="index.html">Home</a>
- </li>
- <li>
- <a href="play.html">Play</a>
- </li>
- <li class="active">
- <a href="register.html">Register</a>
- </li>
- <li>
- <a href="account.html">Account</a>
- </li>
- <li>
- <a href="highscores.html">Highscores</a>
- </li>
- <li>
- <a href="blog.html">Blog</a>
- </li>
- </ul>
- </div>
- </div>
- </div>
- <div class="container register">
- <div class="well bs-component">
- <form class="form-horizontal" action="php/register.php" method="POST">
- <fieldset>
- <legend>
- Register
- <h5>Create a new account</h5>
- </legend>
- <div class="form-group">
- <div class="input-group">
- <span class="input-group-addon icon"><i class="fa fa-user"></i></span>
- <div class="col-lg-12">
- <input type="text" class="form-control" name="Username" placeholder="Username" required>
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="input-group">
- <span class="input-group-addon icon"><i class="fa fa-envelope"></i></span>
- <div class="col-lg-12">
- <input type="email" class="form-control" name="Email" placeholder="Email" required>
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="input-group">
- <span class="input-group-addon icon"><i class="fa fa-lock"></i></span>
- <div class="col-lg-12">
- <input type="password" class="form-control" name="Password" placeholder="Password" required>
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="input-group">
- <span class="input-group-addon icon"><i class="fa fa-lock"></i></span>
- <div class="col-lg-12">
- <input type="password" class="form-control" name="RepeatPassword" placeholder="Repeat Password" required>
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="col-lg-10 col-lg-offset-2">
- <button type="submit" class="btn btn-primary" name="Submit">Create penguin</button>
- </div>
- </div>
- </fieldset>
- </form>
- </div>
- </div>
- <div class="footer-container">
- <div class="footer-top" id="footer-scroll">
- <div class="container">
- <div class="col-md-6">
- <h3>Latest News</h3>
- <a href="blog.html#5">Game Release</a>
- <a href="blog.html#4">Latest News 2</a>
- <a href="blog.html#3">Latest News 3</a>
- <a href="blog.html#2">Latest News 4</a>
- </div>
- <div class="col-md-6">
- <h3>Recent Tweets</h3>
- <a href="#" class="tweet">@wizguin New Website Theme</a>
- <a class="tweet-date">9 September 2016</a>
- <a href="#" class="tweet">@wizguin New Website Theme</a>
- <a class="tweet-date">9 September 2016</a>
- </div>
- </div>
- </div>
- <div class="container footer">
- Wizguin ©
- <div style="float:right;">Some rights reserved to Disney, Club Penguin™</div>
- </div>
- </div>
- </body>
- </html>'
- ];
- echo $page;
- # If the "CREATE PENGUIN" button was pressed
- if(isset($register)) {
- mysql_connect($server, $username, $password);
- # If the connection fails
- if(!$conn) {
- die("Failed to connect to the server: " . mysql_error());
- }
- # Queries for an existing name, to prevent over-write
- $res = mysql_db_query("wizguin", 'SELECT Username FROM users WHERE Username="' . $user . '"');
- # If name exists in SQL
- if(mysql_num_rows($res) != 0) {
- die("That username already exists.");
- }
- # If the password and repeated are the same
- if($pass == $repass) {
- # If the passwords are 4-30
- if(strlen($pass) >= 4 && strlen($pass) <= 30) {
- # If the username is 4-12
- if(strlen($user) >= 4 && strlen($user) <= 12) {
- mysql_db_query("wizguin", 'INSERT INTO users (Username, Password, LoginKey, RegisteredTime, Buddies, Ignores, Inventory) VALUES ("' . $user . '", "' . $pass . '", "' . rand(0, 10000000) . 'oi", "' . time() . '", "[[]]", "[]", "["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","413"]")');
- mysql_close();
- echo '<meta http-equiv="refresh" content="0; url=http://wizguin.byethost3.com/register.html?acc=1" />';
- }
- else echo "Username is too long/short";
- }
- else echo "Passwords are too long/short";
- }
- # If the password and repeated aren't the same
- if($pass != $repass) {
- mysql_close();
- die("Both passwords to not match.");
- }
- }
- mysql_close();
- else echo '<meta http-equiv="refresh" content="0; url=http://wizguin.byethost3.com/register.html" />';
- ?>
- avdverb
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement