Advertisement
Guest User

Untitled

a guest
Feb 18th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.48 KB | None | 0 0
  1. <?php include "../assets/database/160216.php"; ?>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5.  
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  8. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
  9. <title>Connect With Me</title>
  10. <!-- CSS -->
  11. <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  12. <link href="../../assets/css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
  13. <link href="../../assets/css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
  14. </head>
  15.  
  16.  
  17.  
  18. <body>
  19.  
  20. <!-- Scripts-->
  21. <script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
  22. <script src="../../assets/js/materialize.js"></script>
  23. <script src="../../assets/js/init.js"></script>
  24.  
  25. <header>
  26. <!--Navigation Menu-->
  27. <div class="navbar-fixed">
  28. <nav class="white" role="navigation">
  29. <div class="nav-wrapper container">
  30. <a id="logo-container" href="../../index.html" class="brand-logo">Connect With Me</a>
  31. <ul class="right hide-on-med-and-down">
  32. <li><a href="../../index.html#about">About</a></li>
  33. <li><a href="../../index.html#contact">Contact</a></li>
  34. <li><a href="../login">Login</a></li>
  35. </ul>
  36.  
  37. <ul id="nav-mobile" class="side-nav">
  38. <li><a href="#about">About</a></li>
  39. <li><a href="#contact">Contact</a></li>
  40. <li><a href="../login">Login</a></li>
  41. </ul>
  42. <a href="#" data-activates="nav-mobile" class="button-collapse"><i class="material-icons">menu</i></a>
  43. </div>
  44. </nav>
  45. </div>
  46.  
  47. <!--Image Header With Text-->
  48. <div id="index-banner" class="parallax-container">
  49. <div class="section no-pad-bot">
  50. <div class="container">
  51. <br><br>
  52. <br> <h1 class="header center teal-text text-lighten-2"><br>Register</h1>
  53. <div class="row center">
  54. <h5 class="header col s12 light">Register And Start Using Immediately.</h5>
  55. </div>
  56. <br><br>
  57. </div>
  58. </div>
  59. <div class="parallax"><img src="../../assets/images/bg.jpg" alt="Unsplashed background img 1"></div>
  60. </div>
  61. </header>
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68. <div id="main" class="center">
  69. <?php
  70. if(!empty($_POST['username']) && !empty($_POST['password']))
  71. {
  72. $username = mysql_real_escape_string($_POST['username']);
  73. $password = md5(mysql_real_escape_string($_POST['password']));
  74. $email = mysql_real_escape_string($_POST['email']);
  75.  
  76. $checkusername = mysql_query("SELECT * FROM users WHERE Username = '".$username."'");
  77.  
  78. if(mysql_num_rows($checkusername) == 2)
  79. {
  80. $folderPath = "../../user".$username;
  81.  
  82. if (!is_dir($folderPath)) {
  83. //--. CODE TO CREATE FOLDER HERE
  84. mkdir($folderpath, 0700);
  85. }
  86. }
  87.  
  88. if(mysql_num_rows($checkusername) == 1)
  89. {
  90. echo "<h1>Error</h1>";
  91. echo "<p>Sorry, that username is taken. Please go back and try again.</p>";
  92. }
  93. else
  94. {
  95. $registerquery = mysql_query("INSERT INTO users (Username, Password, EmailAddress) VALUES('".$username."', '".$password."', '".$email."')");
  96. if($registerquery)
  97. {
  98. echo "<h1>Success</h1>";
  99. echo "<p>Your account was successfully created. Please <a href="../index.php">click here to login</a>.</p>";
  100. }
  101. else
  102. {
  103. echo "<h1>Error</h1>";
  104. echo "<p>Sorry, your registration failed. Please go back and try again.</p>";
  105. }
  106. }
  107. }
  108. else
  109. {
  110. ?>
  111.  
  112. <main>
  113. <br>
  114. <div class="container">
  115. <div class="section">
  116.  
  117.  
  118. <form method="post" action="index.php" name="registerform" id="registerform" class="col s12">
  119.  
  120. <div class="row">
  121. <div class="input-field col s12">
  122. <input type="text" name="username" id="username">
  123. <label for="username">Username</label>
  124. </div>
  125. <div class="input-field col s12">
  126. <input id="password" type="password" name="password" class="validate">
  127. <label for="password">Password</label>
  128. </div>
  129. </div>
  130. <div class="row">
  131. <div class="input-field col s12">
  132. <input id="email" type="text" name="email" id="email" class="validate">
  133. <label for="email">Email</label>
  134. </div>
  135. </div>
  136. <button class="btn waves-effect waves-light center" type="submit" name="register" id="register">Register</button>
  137. </form>
  138. </div>
  139.  
  140. <?php
  141. }
  142. ?>
  143.  
  144. </div>
  145.  
  146. </body>
  147. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement