Advertisement
Guest User

Untitled

a guest
Feb 27th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.68 KB | None | 0 0
  1. <!--A Design by W3layouts
  2. Author: W3layout
  3. Author URL: http://w3layouts.com
  4. License: Creative Commons Attribution 3.0 Unported
  5. License URL: http://creativecommons.org/licenses/by/3.0/
  6. -->
  7. <!DOCTYPE html>
  8. <html lang="en">
  9. <head>
  10. <title>N-Air</title>
  11. <meta name="viewport" content="width=device-width, initial-scale=1">
  12. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  13. <meta name="keywords" content="N-Air Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template, Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
  14. <script type="application/x-javascript"> addEventListener("load", function() {setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
  15. <meta charset utf="8">
  16. <!--fonts-->
  17. <link href='//fonts.googleapis.com/css?family=Fredoka+One' rel='stylesheet' type='text/css'>
  18.  
  19. <!--fonts-->
  20. <!--bootstrap-->
  21. <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
  22. <!--coustom css-->
  23. <link href="css/style.css" rel="stylesheet" type="text/css"/>
  24. <!--shop-kart-js-->
  25. <script src="js/simpleCart.min.js"></script>
  26. <!--default-js-->
  27. <script src="js/jquery-2.1.4.min.js"></script>
  28. <!--bootstrap-js-->
  29. <script src="js/bootstrap.min.js"></script>
  30. <!--script-->
  31. <!-- FlexSlider -->
  32. <script src="js/imagezoom.js"></script>
  33. <script defer src="js/jquery.flexslider.js"></script>
  34. <link rel="stylesheet" href="css/flexslider.css" type="text/css" media="screen" />
  35.  
  36. <script>
  37. // Can also be used with $(document).ready()
  38. $(window).load(function() {
  39. $('.flexslider').flexslider({
  40. animation: "slide",
  41. controlNav: "thumbnails"
  42. });
  43. });
  44. </script>
  45. <!-- //FlexSlider-->
  46. </head>
  47. <body>
  48. <?php
  49. /*
  50. NEW.PHP
  51. Allows user to create a new entry in the database
  52. */
  53.  
  54. // creates the new record form
  55. // since this form is used multiple times in this file, I have made it a function that is easily reusable
  56. function renderForm($first, $last,$username,$password, $error)
  57. {
  58. ?>
  59. <div class="header">
  60. <div class="container">
  61. <div class="header-top">
  62. <div class="logo">
  63. <a href="index.html">N-AIR</a>
  64. </div>
  65. <div class="login-bars">
  66. <a class="btn btn-default log-bar" href="register.html" role="button">Sign up</a>
  67. <a class="btn btn-default log-bar" href="signup.html" role="button">Login</a>
  68. <div class="cart box_1">
  69.  
  70. </div>
  71. <div class="clearfix"></div>
  72. </div>
  73. <!---menu-----bar--->
  74. <div class="header-botom">
  75. <div class="content white">
  76. <nav class="navbar navbar-default nav-menu" role="navigation">
  77. <div class="navbar-header">
  78. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
  79. <span class="sr-only">Toggle navigation</span>
  80. <span class="icon-bar"></span>
  81. <span class="icon-bar"></span>
  82. <span class="icon-bar"></span>
  83. </button>
  84. </div>
  85. <!--/.navbar-header-->
  86.  
  87. <div class="collapse navbar-collapse collapse-pdng" id="bs-example-navbar-collapse-1">
  88. <ul class="nav navbar-nav nav-font">
  89.  
  90.  
  91. <div class="col-sm-4 menu-img-pad">
  92.  
  93. </div>
  94. <div class="col-sm-4 menu-img-pad">
  95.  
  96. </div>
  97. </ul>
  98. </li>
  99.  
  100. <div class="col-sm-6">
  101.  
  102. </div>
  103. </div>
  104. </ul>
  105. </li>
  106.  
  107. <div class="clearfix"></div>
  108. </ul>
  109. <div class="clearfix"></div>
  110. </div>
  111. <!--/.navbar-collapse-->
  112. <div class="clearfix"></div>
  113. </nav>
  114. <!--/.navbar-->
  115. <div class="clearfix"></div>
  116. </div>
  117. <!--/.content--->
  118. </div>
  119. <!--header-bottom-->
  120. </div>
  121. </div>
  122. <div class="head-bread">
  123. <div class="container">
  124. <ol class="breadcrumb">
  125. <li><a href="index.html">Home</a></li>
  126. <li><a href="register.html">LOGIN</a></li>
  127. <li class="active">REGISTER</li>
  128. </ol>
  129. </div>
  130. </div>
  131. <!-- reg-form -->
  132. <?php
  133. // if there are any errors, display them
  134. if ($error != '')
  135. {
  136. echo '<div style="padding:4px; border:1px solid red; color:red;">'.$error.'</div>';
  137. }
  138. ?>
  139. <div class="reg-form">
  140. <div class="container">
  141. <div class="reg">
  142. <h3>Register Now</h3>
  143. <p>Welcome, please enter the following details to continue.</p>
  144. <p>If you have previously registered with us, <a href="#">click here</a></p>
  145. <form>
  146. <ul>
  147. <li class="text-info">First Name: </li>
  148. <li><input type="text" value="<?php echo $first;?>"></li>
  149. </ul>
  150. <ul>
  151. <li class="text-info">Last Name: </li>
  152. <li><input type="text" value="<?php echo $last; ?>"></li>
  153. </ul>
  154. <ul>
  155. <li class="text-info">Username: </li>
  156. <li><input type="text" value="<?php echo $username; ?>></li>
  157. </ul>
  158. <ul>
  159. <li class="text-info">Password: </li>
  160. <li><input type="password" value="<?php echo $password; ?>"></li>
  161. </ul>
  162. <input type="submit" name="register" value="REGISTER">
  163. </form>
  164. <?php
  165.  
  166.  
  167.  
  168.  
  169. // connect to the database
  170. include('connectdb.php');
  171.  
  172. // check if the form has been submitted. If it has, start to process the form and save it to the database
  173. if (isset($_POST['registerss']))
  174. {
  175. // get form data, making sure it is valid
  176. $firstname = mysql_real_escape_string(htmlspecialchars($_POST['firstname']));
  177. $lastname = mysql_real_escape_string(htmlspecialchars($_POST['lastname']));
  178. $username = mysql_real_escape_string(htmlspecialchars($_POST['username']));
  179. $password = mysql_real_escape_string(htmlspecialchars($_POST['password']));
  180. // check to make sure both fields are entered
  181. if ($firstname == '' || $lastname == ''|| $username == ''|| $password == '')
  182. {
  183. // generate error message
  184. $error = 'ERROR: Please fill in all required fields!';
  185.  
  186. // if either field is blank, display the form again
  187. renderForm($firstname, $lastname,$username,$password, $error);
  188. }
  189. else
  190. {
  191. // save the data to the database
  192. mysql_query("INSERT registerss SET firstname='$firstname', lastname='$lastname',username='$username', password='$password'")
  193. or die(mysql_error());
  194.  
  195.  
  196. // once saved, redirect back to the view page
  197. echo "<font color='green'>Registered successfully.";
  198. //header("Location: signup.php");
  199. }
  200. }
  201. else
  202. // if the form hasn't been submitted, display the form
  203. {
  204. renderForm('','','','','');
  205. }
  206. ?>
  207. </div>
  208. </div>
  209. </div>
  210. <div class="footer-grid">
  211. <div class="container">
  212. <div class="col-md-2 re-ft-grd">
  213.  
  214. </div>
  215. <div class="col-md-2 re-ft-grd">
  216. <h3>Short links</h3>
  217. <ul class="shot-links">
  218. <li><a href="#">Contact us</a></li>
  219. <li><a href="#">Support</a></li>
  220. <li><a href="#">Delivery</a></li>
  221. <li><a href="#">Return Policy</a></li>
  222. <li><a href="#">Terms & conditions</a></li>
  223. <li><a href="contact.html">Sitemap</a></li>
  224. </ul>
  225. </div>
  226. <div class="col-md-6 re-ft-grd">
  227. <h3>Social</h3>
  228. <ul class="social">
  229. <li><a href="#" class="fb">facebook</a></li>
  230. <li><a href="#" class="twt">twitter</a></li>
  231. <li><a href="#" class="gpls">g+ plus</a></li>
  232. <div class="clearfix"></div>
  233. </ul>
  234. </div>
  235. <div class="col-md-2 re-ft-grd">
  236. <div class="bt-logo">
  237. <div class="logo">
  238. <a href="index.html" class="ft-log">N-AIR</a>
  239. </div>
  240. </div>
  241. </div>
  242. <div class="clearfix"></div>
  243. </div>
  244. <div class="copy-rt">
  245. <div class="container">
  246. <p>&copy; 2016 N-AIR All Rights Reserved</a></p>
  247. </div>
  248. </div>
  249. </div>
  250. </body>
  251. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement