Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--A Design by W3layouts
- Author: W3layout
- Author URL: http://w3layouts.com
- License: Creative Commons Attribution 3.0 Unported
- License URL: http://creativecommons.org/licenses/by/3.0/
- -->
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>N-Air</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <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" />
- <script type="application/x-javascript"> addEventListener("load", function() {setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
- <meta charset utf="8">
- <!--fonts-->
- <link href='//fonts.googleapis.com/css?family=Fredoka+One' rel='stylesheet' type='text/css'>
- <!--fonts-->
- <!--bootstrap-->
- <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
- <!--coustom css-->
- <link href="css/style.css" rel="stylesheet" type="text/css"/>
- <!--shop-kart-js-->
- <script src="js/simpleCart.min.js"></script>
- <!--default-js-->
- <script src="js/jquery-2.1.4.min.js"></script>
- <!--bootstrap-js-->
- <script src="js/bootstrap.min.js"></script>
- <!--script-->
- <!-- FlexSlider -->
- <script src="js/imagezoom.js"></script>
- <script defer src="js/jquery.flexslider.js"></script>
- <link rel="stylesheet" href="css/flexslider.css" type="text/css" media="screen" />
- <script>
- // Can also be used with $(document).ready()
- $(window).load(function() {
- $('.flexslider').flexslider({
- animation: "slide",
- controlNav: "thumbnails"
- });
- });
- </script>
- <!-- //FlexSlider-->
- </head>
- <body>
- <?php
- /*
- NEW.PHP
- Allows user to create a new entry in the database
- */
- // creates the new record form
- // since this form is used multiple times in this file, I have made it a function that is easily reusable
- function renderForm($first, $last,$username,$password, $error)
- {
- ?>
- <div class="header">
- <div class="container">
- <div class="header-top">
- <div class="logo">
- <a href="index.html">N-AIR</a>
- </div>
- <div class="login-bars">
- <a class="btn btn-default log-bar" href="register.html" role="button">Sign up</a>
- <a class="btn btn-default log-bar" href="signup.html" role="button">Login</a>
- <div class="cart box_1">
- </div>
- <div class="clearfix"></div>
- </div>
- <!---menu-----bar--->
- <div class="header-botom">
- <div class="content white">
- <nav class="navbar navbar-default nav-menu" role="navigation">
- <div class="navbar-header">
- <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
- <span class="sr-only">Toggle navigation</span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
- </div>
- <!--/.navbar-header-->
- <div class="collapse navbar-collapse collapse-pdng" id="bs-example-navbar-collapse-1">
- <ul class="nav navbar-nav nav-font">
- <div class="col-sm-4 menu-img-pad">
- </div>
- <div class="col-sm-4 menu-img-pad">
- </div>
- </ul>
- </li>
- <div class="col-sm-6">
- </div>
- </div>
- </ul>
- </li>
- <div class="clearfix"></div>
- </ul>
- <div class="clearfix"></div>
- </div>
- <!--/.navbar-collapse-->
- <div class="clearfix"></div>
- </nav>
- <!--/.navbar-->
- <div class="clearfix"></div>
- </div>
- <!--/.content--->
- </div>
- <!--header-bottom-->
- </div>
- </div>
- <div class="head-bread">
- <div class="container">
- <ol class="breadcrumb">
- <li><a href="index.html">Home</a></li>
- <li><a href="register.html">LOGIN</a></li>
- <li class="active">REGISTER</li>
- </ol>
- </div>
- </div>
- <!-- reg-form -->
- <?php
- // if there are any errors, display them
- if ($error != '')
- {
- echo '<div style="padding:4px; border:1px solid red; color:red;">'.$error.'</div>';
- }
- ?>
- <div class="reg-form">
- <div class="container">
- <div class="reg">
- <h3>Register Now</h3>
- <p>Welcome, please enter the following details to continue.</p>
- <p>If you have previously registered with us, <a href="#">click here</a></p>
- <form>
- <ul>
- <li class="text-info">First Name: </li>
- <li><input type="text" value="<?php echo $first;?>"></li>
- </ul>
- <ul>
- <li class="text-info">Last Name: </li>
- <li><input type="text" value="<?php echo $last; ?>"></li>
- </ul>
- <ul>
- <li class="text-info">Username: </li>
- <li><input type="text" value="<?php echo $username; ?>></li>
- </ul>
- <ul>
- <li class="text-info">Password: </li>
- <li><input type="password" value="<?php echo $password; ?>"></li>
- </ul>
- <input type="submit" name="register" value="REGISTER">
- </form>
- <?php
- // connect to the database
- include('connectdb.php');
- // check if the form has been submitted. If it has, start to process the form and save it to the database
- if (isset($_POST['registerss']))
- {
- // get form data, making sure it is valid
- $firstname = mysql_real_escape_string(htmlspecialchars($_POST['firstname']));
- $lastname = mysql_real_escape_string(htmlspecialchars($_POST['lastname']));
- $username = mysql_real_escape_string(htmlspecialchars($_POST['username']));
- $password = mysql_real_escape_string(htmlspecialchars($_POST['password']));
- // check to make sure both fields are entered
- if ($firstname == '' || $lastname == ''|| $username == ''|| $password == '')
- {
- // generate error message
- $error = 'ERROR: Please fill in all required fields!';
- // if either field is blank, display the form again
- renderForm($firstname, $lastname,$username,$password, $error);
- }
- else
- {
- // save the data to the database
- mysql_query("INSERT registerss SET firstname='$firstname', lastname='$lastname',username='$username', password='$password'")
- or die(mysql_error());
- // once saved, redirect back to the view page
- echo "<font color='green'>Registered successfully.";
- //header("Location: signup.php");
- }
- }
- else
- // if the form hasn't been submitted, display the form
- {
- renderForm('','','','','');
- }
- ?>
- </div>
- </div>
- </div>
- <div class="footer-grid">
- <div class="container">
- <div class="col-md-2 re-ft-grd">
- </div>
- <div class="col-md-2 re-ft-grd">
- <h3>Short links</h3>
- <ul class="shot-links">
- <li><a href="#">Contact us</a></li>
- <li><a href="#">Support</a></li>
- <li><a href="#">Delivery</a></li>
- <li><a href="#">Return Policy</a></li>
- <li><a href="#">Terms & conditions</a></li>
- <li><a href="contact.html">Sitemap</a></li>
- </ul>
- </div>
- <div class="col-md-6 re-ft-grd">
- <h3>Social</h3>
- <ul class="social">
- <li><a href="#" class="fb">facebook</a></li>
- <li><a href="#" class="twt">twitter</a></li>
- <li><a href="#" class="gpls">g+ plus</a></li>
- <div class="clearfix"></div>
- </ul>
- </div>
- <div class="col-md-2 re-ft-grd">
- <div class="bt-logo">
- <div class="logo">
- <a href="index.html" class="ft-log">N-AIR</a>
- </div>
- </div>
- </div>
- <div class="clearfix"></div>
- </div>
- <div class="copy-rt">
- <div class="container">
- <p>© 2016 N-AIR All Rights Reserved</a></p>
- </div>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement