Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php include "../assets/database/160216.php"; ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
- <title>Connect With Me</title>
- <!-- CSS -->
- <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
- <link href="../../assets/css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
- <link href="../../assets/css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
- </head>
- <body>
- <!-- Scripts-->
- <script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
- <script src="../../assets/js/materialize.js"></script>
- <script src="../../assets/js/init.js"></script>
- <header>
- <!--Navigation Menu-->
- <div class="navbar-fixed">
- <nav class="white" role="navigation">
- <div class="nav-wrapper container">
- <a id="logo-container" href="../../index.html" class="brand-logo">Connect With Me</a>
- <ul class="right hide-on-med-and-down">
- <li><a href="../../index.html#about">About</a></li>
- <li><a href="../../index.html#contact">Contact</a></li>
- <li><a href="../login">Login</a></li>
- </ul>
- <ul id="nav-mobile" class="side-nav">
- <li><a href="#about">About</a></li>
- <li><a href="#contact">Contact</a></li>
- <li><a href="../login">Login</a></li>
- </ul>
- <a href="#" data-activates="nav-mobile" class="button-collapse"><i class="material-icons">menu</i></a>
- </div>
- </nav>
- </div>
- <!--Image Header With Text-->
- <div id="index-banner" class="parallax-container">
- <div class="section no-pad-bot">
- <div class="container">
- <br><br>
- <br> <h1 class="header center teal-text text-lighten-2"><br>Register</h1>
- <div class="row center">
- <h5 class="header col s12 light">Register And Start Using Immediately.</h5>
- </div>
- <br><br>
- </div>
- </div>
- <div class="parallax"><img src="../../assets/images/bg.jpg" alt="Unsplashed background img 1"></div>
- </div>
- </header>
- <div id="main" class="center">
- <?php
- if(!empty($_POST['username']) && !empty($_POST['password']))
- {
- $username = mysql_real_escape_string($_POST['username']);
- $password = md5(mysql_real_escape_string($_POST['password']));
- $email = mysql_real_escape_string($_POST['email']);
- $checkusername = mysql_query("SELECT * FROM users WHERE Username = '".$username."'");
- if(mysql_num_rows($checkusername) == 2)
- {
- $folderPath = "../../user".$username;
- if (!is_dir($folderPath)) {
- //--. CODE TO CREATE FOLDER HERE
- mkdir($folderpath, 0700);
- }
- }
- if(mysql_num_rows($checkusername) == 1)
- {
- echo "<h1>Error</h1>";
- echo "<p>Sorry, that username is taken. Please go back and try again.</p>";
- }
- else
- {
- $registerquery = mysql_query("INSERT INTO users (Username, Password, EmailAddress) VALUES('".$username."', '".$password."', '".$email."')");
- if($registerquery)
- {
- echo "<h1>Success</h1>";
- echo "<p>Your account was successfully created. Please <a href="../index.php">click here to login</a>.</p>";
- }
- else
- {
- echo "<h1>Error</h1>";
- echo "<p>Sorry, your registration failed. Please go back and try again.</p>";
- }
- }
- }
- else
- {
- ?>
- <main>
- <br>
- <div class="container">
- <div class="section">
- <form method="post" action="index.php" name="registerform" id="registerform" class="col s12">
- <div class="row">
- <div class="input-field col s12">
- <input type="text" name="username" id="username">
- <label for="username">Username</label>
- </div>
- <div class="input-field col s12">
- <input id="password" type="password" name="password" class="validate">
- <label for="password">Password</label>
- </div>
- </div>
- <div class="row">
- <div class="input-field col s12">
- <input id="email" type="text" name="email" id="email" class="validate">
- <label for="email">Email</label>
- </div>
- </div>
- <button class="btn waves-effect waves-light center" type="submit" name="register" id="register">Register</button>
- </form>
- </div>
- <?php
- }
- ?>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement