Advertisement
Guest User

Finale

a guest
Sep 20th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 20.89 KB | None | 0 0
  1. <?
  2.  
  3. // Config vars
  4. include("../config/config.php");
  5.  
  6. // Variables
  7. $register = $_POST["Submit"];
  8. $user = $_POST["Username"];
  9. $pass = $_POST["Password"];
  10. $repass = $_POST["RepeatPassword"];
  11. $email = $_POST["Email"];
  12.  
  13. # If the "CREATE PENGUIN" button was pressed
  14. if(isset($register)) {
  15.    
  16.     mysql_connect($server, $username, $password);
  17.    
  18.     if(!$conn) {
  19.         die('<!DOCTYPE html>
  20. <html lang="en">
  21.  
  22. <head>
  23.    <meta charset="utf-8">
  24.    <title>Wizguin - Register</title>
  25.    <link rel="shortcut icon" href="assets/favicon-magic.ico">
  26.    <meta name="viewport" content="width=device-width, initial-scale=1">
  27.    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" media="screen">
  28.    <link rel="stylesheet" href="fontawesome/css/font-awesome.min.css">
  29.    <link rel="stylesheet" href="css/hover-min.css">
  30.    <link rel="stylesheet" href="css/styles.css">
  31.     <link rel="stylesheet" href="css/register.css">
  32. </head>
  33.  
  34. <body>
  35.    <div class="navbar navbar-default">
  36.        <div class="container">
  37.            <div class="navbar-header">
  38.                <a class="navbar-brand">Wizguin</a>
  39.                <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#navbar-main">
  40.                    <span class="icon-bar"></span>
  41.                    <span class="icon-bar"></span>
  42.                    <span class="icon-bar"></span>
  43.                </button>
  44.            </div>
  45.            <div class="navbar-collapse collapse" id="navbar-main">
  46.                <ul class="nav navbar-nav navbar-right">
  47.                    <li>
  48.                        <a href="http://wizguin.byethost3.com/">Home</a>
  49.                    </li>
  50.                    <li>
  51.                        <a href="http://wizguin.byethost3.com/play.html">Play</a>
  52.                    </li>
  53.                    <li class="active">
  54.                        <a href="http://wizguin.byethost3.com/register.html">Register</a>
  55.                    </li>
  56.                    <li>
  57.                        <a href="http://wizguin.byethost3.com/account.html">Account</a>
  58.                    </li>
  59.                    <li>
  60.                        <a href="http://wizguin.byethost3.com/highscores.html">Highscores</a>
  61.                    </li>
  62.                    <li>
  63.                        <a href="http://wizguin.byethost3.com/blog.html">Blog</a>
  64.                    </li>
  65.                </ul>
  66.            </div>
  67.        </div>
  68.    </div>
  69.  
  70.    <div class="container register">
  71.         <div class="well bs-component">
  72.             <fieldset>
  73.                <legend>
  74.                     Register
  75.                 </legend>
  76.                 <h5> <strong> Error: </strong> We have failed to contact the server. Reason: ' . mysql_error() . ' </h5>
  77.            </fieldset>
  78.        </div>
  79.    </div>
  80.    <div class="footer-container">
  81.        <div class="footer-top" id="footer-scroll">
  82.            <div class="container">
  83.             <div class="col-md-6">
  84.                 <h3>Latest News</h3>
  85.                 <a href="blog.html#5">Game Release</a>
  86.                 <a href="blog.html#4">Latest News 2</a>
  87.                 <a href="blog.html#3">Latest News 3</a>
  88.                 <a href="blog.html#2">Latest News 4</a>
  89.             </div>
  90.             <div class="col-md-6">
  91.                 <h3>Recent Tweets</h3>
  92.                 <a href="#" class="tweet">@wizguin New Website Theme</a>
  93.                 <a class="tweet-date">9 September 2016</a>
  94.                 <a href="#" class="tweet">@wizguin New Website Theme</a>
  95.                 <a class="tweet-date">9 September 2016</a>
  96.             </div>
  97.            </div>
  98.        </div>
  99.        <div class="container footer">
  100.            Wizguin ©
  101.            <div style="float:right;">Some rights reserved to Disney, Club Penguin™</div>
  102.        </div>
  103.    </div>
  104.  
  105. </body>
  106.  
  107. </html>');
  108.     }
  109.    
  110.     # Queries for an existing name, to prevent over-write
  111.     $res = mysql_db_query("wizguin", 'SELECT Username FROM users WHERE Username="' . $user . '"');
  112.    
  113.     # If name exists in SQL
  114.     if(mysql_num_rows($res) != 0) {
  115.         die('<!DOCTYPE html>
  116. <html lang="en">
  117.  
  118. <head>
  119.    <meta charset="utf-8">
  120.    <title>Wizguin - Register</title>
  121.    <link rel="shortcut icon" href="assets/favicon-magic.ico">
  122.    <meta name="viewport" content="width=device-width, initial-scale=1">
  123.    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" media="screen">
  124.    <link rel="stylesheet" href="fontawesome/css/font-awesome.min.css">
  125.    <link rel="stylesheet" href="css/hover-min.css">
  126.    <link rel="stylesheet" href="css/styles.css">
  127.     <link rel="stylesheet" href="css/register.css">
  128. </head>
  129.  
  130. <body>
  131.    <div class="navbar navbar-default">
  132.        <div class="container">
  133.            <div class="navbar-header">
  134.                <a class="navbar-brand">Wizguin</a>
  135.                <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#navbar-main">
  136.                    <span class="icon-bar"></span>
  137.                    <span class="icon-bar"></span>
  138.                    <span class="icon-bar"></span>
  139.                </button>
  140.            </div>
  141.            <div class="navbar-collapse collapse" id="navbar-main">
  142.                <ul class="nav navbar-nav navbar-right">
  143.                    <li>
  144.                        <a href="http://wizguin.byethost3.com/">Home</a>
  145.                    </li>
  146.                    <li>
  147.                        <a href="http://wizguin.byethost3.com/play.html">Play</a>
  148.                    </li>
  149.                    <li class="active">
  150.                        <a href="http://wizguin.byethost3.com/register.html">Register</a>
  151.                    </li>
  152.                    <li>
  153.                        <a href="http://wizguin.byethost3.com/account.html">Account</a>
  154.                    </li>
  155.                    <li>
  156.                        <a href="http://wizguin.byethost3.com/highscores.html">Highscores</a>
  157.                    </li>
  158.                    <li>
  159.                        <a href="http://wizguin.byethost3.com/blog.html">Blog</a>
  160.                    </li>
  161.                </ul>
  162.            </div>
  163.        </div>
  164.    </div>
  165.  
  166.    <div class="container register">
  167.         <div class="well bs-component">
  168.             <fieldset>
  169.                <legend>
  170.                     Register
  171.                 </legend>
  172.                 <h5> <strong> Error: </strong> The username you have selected already exists. Please try again. </h5>
  173.            </fieldset>
  174.        </div>
  175.    </div>
  176.    <div class="footer-container">
  177.        <div class="footer-top" id="footer-scroll">
  178.            <div class="container">
  179.             <div class="col-md-6">
  180.                 <h3>Latest News</h3>
  181.                 <a href="blog.html#5">Game Release</a>
  182.                 <a href="blog.html#4">Latest News 2</a>
  183.                 <a href="blog.html#3">Latest News 3</a>
  184.                 <a href="blog.html#2">Latest News 4</a>
  185.             </div>
  186.             <div class="col-md-6">
  187.                 <h3>Recent Tweets</h3>
  188.                 <a href="#" class="tweet">@wizguin New Website Theme</a>
  189.                 <a class="tweet-date">9 September 2016</a>
  190.                 <a href="#" class="tweet">@wizguin New Website Theme</a>
  191.                 <a class="tweet-date">9 September 2016</a>
  192.             </div>
  193.            </div>
  194.        </div>
  195.        <div class="container footer">
  196.            Wizguin ©
  197.            <div style="float:right;">Some rights reserved to Disney, Club Penguin™</div>
  198.        </div>
  199.    </div>
  200.  
  201. </body>
  202.  
  203. </html>');
  204.     }
  205.    
  206.     # If the password and repeated are the same
  207.     if($pass == $repass) {
  208.         # If the passwords are 4-30
  209.         if(strlen($pass) >= 4 && strlen($pass) <= 30) {
  210.             # If the username is 4-12
  211.             if(strlen($user) >= 4 && strlen($user) <= 12) {
  212.                 mysql_db_query("wizguin", 'INSERT INTO users (Email, Username, Password, LoginKey, RegisteredTime, Buddies, Ignores, Inventory) VALUES ("' . $email . '", "' . $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"]")');
  213.                 mysql_close();
  214.                 echo '
  215. <!DOCTYPE html>
  216. <html lang="en">
  217.  
  218. <head>
  219.    <meta charset="utf-8">
  220.    <title>Wizguin - Register</title>
  221.    <link rel="shortcut icon" href="assets/favicon-magic.ico">
  222.    <meta name="viewport" content="width=device-width, initial-scale=1">
  223.    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" media="screen">
  224.    <link rel="stylesheet" href="fontawesome/css/font-awesome.min.css">
  225.    <link rel="stylesheet" href="css/hover-min.css">
  226.    <link rel="stylesheet" href="css/styles.css">
  227.     <link rel="stylesheet" href="css/register.css">
  228. </head>
  229.  
  230. <body>
  231.    <div class="navbar navbar-default">
  232.        <div class="container">
  233.            <div class="navbar-header">
  234.                <a class="navbar-brand">Wizguin</a>
  235.                <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#navbar-main">
  236.                    <span class="icon-bar"></span>
  237.                    <span class="icon-bar"></span>
  238.                    <span class="icon-bar"></span>
  239.                </button>
  240.            </div>
  241.            <div class="navbar-collapse collapse" id="navbar-main">
  242.                <ul class="nav navbar-nav navbar-right">
  243.                    <li>
  244.                        <a href="http://wizguin.byethost3.com/">Home</a>
  245.                    </li>
  246.                    <li>
  247.                        <a href="http://wizguin.byethost3.com/play.html">Play</a>
  248.                    </li>
  249.                    <li class="active">
  250.                        <a href="http://wizguin.byethost3.com/register.html">Register</a>
  251.                    </li>
  252.                    <li>
  253.                        <a href="http://wizguin.byethost3.com/account.html">Account</a>
  254.                    </li>
  255.                    <li>
  256.                        <a href="http://wizguin.byethost3.com/highscores.html">Highscores</a>
  257.                    </li>
  258.                    <li>
  259.                        <a href="http://wizguin.byethost3.com/blog.html">Blog</a>
  260.                    </li>
  261.                </ul>
  262.            </div>
  263.        </div>
  264.    </div>
  265.  
  266.    <div class="container register">
  267.         <div class="well bs-component">
  268.             <fieldset>
  269.                <legend>
  270.                     Register
  271.                 </legend>
  272.                 <h5> You have successfully created a new account! Click Play to go online and play! </h5>
  273.            </fieldset>
  274.        </div>
  275.    </div>
  276.    <div class="footer-container">
  277.        <div class="footer-top" id="footer-scroll">
  278.            <div class="container">
  279.             <div class="col-md-6">
  280.                 <h3>Latest News</h3>
  281.                 <a href="blog.html#5">Game Release</a>
  282.                 <a href="blog.html#4">Latest News 2</a>
  283.                 <a href="blog.html#3">Latest News 3</a>
  284.                 <a href="blog.html#2">Latest News 4</a>
  285.             </div>
  286.             <div class="col-md-6">
  287.                 <h3>Recent Tweets</h3>
  288.                 <a href="#" class="tweet">@wizguin New Website Theme</a>
  289.                 <a class="tweet-date">9 September 2016</a>
  290.                 <a href="#" class="tweet">@wizguin New Website Theme</a>
  291.                 <a class="tweet-date">9 September 2016</a>
  292.             </div>
  293.            </div>
  294.        </div>
  295.        <div class="container footer">
  296.            Wizguin ©
  297.            <div style="float:right;">Some rights reserved to Disney, Club Penguin™</div>
  298.        </div>
  299.    </div>
  300.  
  301. </body>
  302.  
  303. </html>';
  304.             }
  305.             else echo '
  306. <!DOCTYPE html>
  307. <html lang="en">
  308.  
  309. <head>
  310.    <meta charset="utf-8">
  311.    <title>Wizguin - Register</title>
  312.    <link rel="shortcut icon" href="assets/favicon-magic.ico">
  313.    <meta name="viewport" content="width=device-width, initial-scale=1">
  314.    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" media="screen">
  315.    <link rel="stylesheet" href="fontawesome/css/font-awesome.min.css">
  316.    <link rel="stylesheet" href="css/hover-min.css">
  317.    <link rel="stylesheet" href="css/styles.css">
  318.     <link rel="stylesheet" href="css/register.css">
  319. </head>
  320.  
  321. <body>
  322.    <div class="navbar navbar-default">
  323.        <div class="container">
  324.            <div class="navbar-header">
  325.                <a class="navbar-brand">Wizguin</a>
  326.                <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#navbar-main">
  327.                    <span class="icon-bar"></span>
  328.                    <span class="icon-bar"></span>
  329.                    <span class="icon-bar"></span>
  330.                </button>
  331.            </div>
  332.            <div class="navbar-collapse collapse" id="navbar-main">
  333.                <ul class="nav navbar-nav navbar-right">
  334.                    <li>
  335.                        <a href="http://wizguin.byethost3.com/">Home</a>
  336.                    </li>
  337.                    <li>
  338.                        <a href="http://wizguin.byethost3.com/play.html">Play</a>
  339.                    </li>
  340.                    <li class="active">
  341.                        <a href="http://wizguin.byethost3.com/register.html">Register</a>
  342.                    </li>
  343.                    <li>
  344.                        <a href="http://wizguin.byethost3.com/account.html">Account</a>
  345.                    </li>
  346.                    <li>
  347.                        <a href="http://wizguin.byethost3.com/highscores.html">Highscores</a>
  348.                    </li>
  349.                    <li>
  350.                        <a href="http://wizguin.byethost3.com/blog.html">Blog</a>
  351.                    </li>
  352.                </ul>
  353.            </div>
  354.        </div>
  355.    </div>
  356.  
  357.    <div class="container register">
  358.         <div class="well bs-component">
  359.             <fieldset>
  360.                <legend>
  361.                     Register
  362.                 </legend>
  363.                 <h5> <strong> Error: </strong> The username you have selected is too long/short. Please try again. </h5>
  364.            </fieldset>
  365.        </div>
  366.    </div>
  367.    <div class="footer-container">
  368.        <div class="footer-top" id="footer-scroll">
  369.            <div class="container">
  370.             <div class="col-md-6">
  371.                 <h3>Latest News</h3>
  372.                 <a href="blog.html#5">Game Release</a>
  373.                 <a href="blog.html#4">Latest News 2</a>
  374.                 <a href="blog.html#3">Latest News 3</a>
  375.                 <a href="blog.html#2">Latest News 4</a>
  376.             </div>
  377.             <div class="col-md-6">
  378.                 <h3>Recent Tweets</h3>
  379.                 <a href="#" class="tweet">@wizguin New Website Theme</a>
  380.                 <a class="tweet-date">9 September 2016</a>
  381.                 <a href="#" class="tweet">@wizguin New Website Theme</a>
  382.                 <a class="tweet-date">9 September 2016</a>
  383.             </div>
  384.            </div>
  385.        </div>
  386.        <div class="container footer">
  387.            Wizguin ©
  388.            <div style="float:right;">Some rights reserved to Disney, Club Penguin™</div>
  389.        </div>
  390.    </div>
  391.  
  392. </body>
  393.  
  394. </html>';
  395.         }
  396.         else echo '
  397. <!DOCTYPE html>
  398. <html lang="en">
  399.  
  400. <head>
  401.    <meta charset="utf-8">
  402.    <title>Wizguin - Register</title>
  403.    <link rel="shortcut icon" href="assets/favicon-magic.ico">
  404.    <meta name="viewport" content="width=device-width, initial-scale=1">
  405.    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" media="screen">
  406.    <link rel="stylesheet" href="fontawesome/css/font-awesome.min.css">
  407.    <link rel="stylesheet" href="css/hover-min.css">
  408.    <link rel="stylesheet" href="css/styles.css">
  409.     <link rel="stylesheet" href="css/register.css">
  410. </head>
  411.  
  412. <body>
  413.    <div class="navbar navbar-default">
  414.        <div class="container">
  415.            <div class="navbar-header">
  416.                <a class="navbar-brand">Wizguin</a>
  417.                <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#navbar-main">
  418.                    <span class="icon-bar"></span>
  419.                    <span class="icon-bar"></span>
  420.                    <span class="icon-bar"></span>
  421.                </button>
  422.            </div>
  423.            <div class="navbar-collapse collapse" id="navbar-main">
  424.                <ul class="nav navbar-nav navbar-right">
  425.                    <li>
  426.                        <a href="http://wizguin.byethost3.com/">Home</a>
  427.                    </li>
  428.                    <li>
  429.                        <a href="http://wizguin.byethost3.com/play.html">Play</a>
  430.                    </li>
  431.                    <li class="active">
  432.                        <a href="http://wizguin.byethost3.com/register.html">Register</a>
  433.                    </li>
  434.                    <li>
  435.                        <a href="http://wizguin.byethost3.com/account.html">Account</a>
  436.                    </li>
  437.                    <li>
  438.                        <a href="http://wizguin.byethost3.com/highscores.html">Highscores</a>
  439.                    </li>
  440.                    <li>
  441.                        <a href="http://wizguin.byethost3.com/blog.html">Blog</a>
  442.                    </li>
  443.                </ul>
  444.            </div>
  445.        </div>
  446.    </div>
  447.  
  448.    <div class="container register">
  449.         <div class="well bs-component">
  450.             <fieldset>
  451.                <legend>
  452.                     Register
  453.                 </legend>
  454.                 <h5> <strong> Error: </strong> The passwords you have selected is too long/short. Please try again. </h5>
  455.            </fieldset>
  456.        </div>
  457.    </div>
  458.    <div class="footer-container">
  459.        <div class="footer-top" id="footer-scroll">
  460.            <div class="container">
  461.             <div class="col-md-6">
  462.                 <h3>Latest News</h3>
  463.                 <a href="blog.html#5">Game Release</a>
  464.                 <a href="blog.html#4">Latest News 2</a>
  465.                 <a href="blog.html#3">Latest News 3</a>
  466.                 <a href="blog.html#2">Latest News 4</a>
  467.             </div>
  468.             <div class="col-md-6">
  469.                 <h3>Recent Tweets</h3>
  470.                 <a href="#" class="tweet">@wizguin New Website Theme</a>
  471.                 <a class="tweet-date">9 September 2016</a>
  472.                 <a href="#" class="tweet">@wizguin New Website Theme</a>
  473.                 <a class="tweet-date">9 September 2016</a>
  474.             </div>
  475.            </div>
  476.        </div>
  477.        <div class="container footer">
  478.            Wizguin ©
  479.            <div style="float:right;">Some rights reserved to Disney, Club Penguin™</div>
  480.        </div>
  481.    </div>
  482.  
  483. </body>
  484.  
  485. </html>';
  486.     }
  487.    
  488.     # If the password and repeated aren't the same
  489.     if($pass != $repass) {
  490.         mysql_close();
  491.         die('<!DOCTYPE html>
  492. <html lang="en">
  493.  
  494. <head>
  495.    <meta charset="utf-8">
  496.    <title>Wizguin - Register</title>
  497.    <link rel="shortcut icon" href="assets/favicon-magic.ico">
  498.    <meta name="viewport" content="width=device-width, initial-scale=1">
  499.    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" media="screen">
  500.    <link rel="stylesheet" href="fontawesome/css/font-awesome.min.css">
  501.    <link rel="stylesheet" href="css/hover-min.css">
  502.    <link rel="stylesheet" href="css/styles.css">
  503.     <link rel="stylesheet" href="css/register.css">
  504. </head>
  505.  
  506. <body>
  507.    <div class="navbar navbar-default">
  508.        <div class="container">
  509.            <div class="navbar-header">
  510.                <a class="navbar-brand">Wizguin</a>
  511.                <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#navbar-main">
  512.                    <span class="icon-bar"></span>
  513.                    <span class="icon-bar"></span>
  514.                    <span class="icon-bar"></span>
  515.                </button>
  516.            </div>
  517.            <div class="navbar-collapse collapse" id="navbar-main">
  518.                <ul class="nav navbar-nav navbar-right">
  519.                    <li>
  520.                        <a href="http://wizguin.byethost3.com/">Home</a>
  521.                    </li>
  522.                    <li>
  523.                        <a href="http://wizguin.byethost3.com/play.html">Play</a>
  524.                    </li>
  525.                    <li class="active">
  526.                        <a href="http://wizguin.byethost3.com/register.html">Register</a>
  527.                    </li>
  528.                    <li>
  529.                        <a href="http://wizguin.byethost3.com/account.html">Account</a>
  530.                    </li>
  531.                    <li>
  532.                        <a href="http://wizguin.byethost3.com/highscores.html">Highscores</a>
  533.                    </li>
  534.                    <li>
  535.                        <a href="http://wizguin.byethost3.com/blog.html">Blog</a>
  536.                    </li>
  537.                </ul>
  538.            </div>
  539.        </div>
  540.    </div>
  541.  
  542.    <div class="container register">
  543.         <div class="well bs-component">
  544.             <fieldset>
  545.                <legend>
  546.                     Register
  547.                 </legend>
  548.                 <h5> <strong> Error: </strong> The passwords you have selected do not match. Please try again. </h5>
  549.            </fieldset>
  550.        </div>
  551.    </div>
  552.    <div class="footer-container">
  553.        <div class="footer-top" id="footer-scroll">
  554.            <div class="container">
  555.             <div class="col-md-6">
  556.                 <h3>Latest News</h3>
  557.                 <a href="blog.html#5">Game Release</a>
  558.                 <a href="blog.html#4">Latest News 2</a>
  559.                 <a href="blog.html#3">Latest News 3</a>
  560.                 <a href="blog.html#2">Latest News 4</a>
  561.             </div>
  562.             <div class="col-md-6">
  563.                 <h3>Recent Tweets</h3>
  564.                 <a href="#" class="tweet">@wizguin New Website Theme</a>
  565.                 <a class="tweet-date">9 September 2016</a>
  566.                 <a href="#" class="tweet">@wizguin New Website Theme</a>
  567.                 <a class="tweet-date">9 September 2016</a>
  568.             </div>
  569.            </div>
  570.        </div>
  571.        <div class="container footer">
  572.            Wizguin ©
  573.            <div style="float:right;">Some rights reserved to Disney, Club Penguin™</div>
  574.        </div>
  575.    </div>
  576.  
  577. </body>
  578.  
  579. </html>');
  580.     }
  581. }
  582.  
  583. mysql_close();
  584. else echo '<meta http-equiv="refresh" content="0; url=http://wizguin.byethost3.com/register.html" />';
  585.  
  586. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement