Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if(isset($_SESSION['user'])!="")
- {
- header("Location: index.php");
- }
- include_once 'dbconnect.php';
- if(isset($_POST['btn-signup']))
- {
- $uname = mysql_real_escape_string($_POST['Username']);
- $uemail = mysql_real_escape_string($_POST['Email']);
- $upass = $_POST['Password'];
- $uname = trim($uname);
- $uemail = trim($uemail);
- $upass = trim($upass);
- // email exist or not
- $query = "SELECT email FROM users WHERE email='$uemail'";
- $result = mysql_query($query);
- $count = mysql_num_rows($result); // if email not found then register
- if($count == 0){
- if(mysql_query("INSERT INTO users(username,password,email) VALUES('$uname','$upass','$uemail')"))
- {
- ?>
- <script>alert('Successfully registered ');</script>
- <?php
- header("Location: login.php");
- }
- else
- {
- $query = "SELECT username FROM users WHERE username='$uname'";
- $result = mysql_query($query);
- $count = mysql_num_rows($result);
- if($count!=0) { ?>
- <script>alert('That username is already taken');</script> <?php
- }else{
- ?>
- <script>alert('Error while registering you...');</script>
- <?php }
- }
- }
- else{
- ?>
- <script>alert('Sorry that email is already taken ...');</script>
- <?php
- }
- }
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="description" content="Team 12, Code App, Level Up, Travel, Agency">
- <title>Register</title>
- <!-- Bootstrap core CSS -->
- <link href="css/bootstrap_nova.css" rel="stylesheet">
- <!--external css-->
- <link href="css/font-awesome/css/font-awesome.css" rel="stylesheet"/>
- <!-- Custom styles for this template -->
- <link href="css/style.css" rel="stylesheet">
- <link href="css/style-responsive.css" rel="stylesheet">
- <style>
- #grad1{
- height: 100px;
- background: red; /* For browsers that do not support gradients */
- background: -webkit-linear-gradient(left top, gold, goldenrod); /* For Safari 5.1 to 6.0 */
- background: -o-linear-gradient(bottom right, gold, goldenrod); /* For Opera 11.1 to 12.0 */
- background: -moz-linear-gradient(bottom right, gold, goldenrod); /* For Firefox 3.6 to 15 */
- background: linear-gradient(to bottom right, gold, goldenrod); /* Standard syntax (must be last) */
- }
- #test1{
- opacity: 0.9;
- }
- </style>
- </head>
- <body>
- <div id="login-page">
- <div class="container">
- <form class="form-login" method="post" id="test1">
- <h2 class="form-login-heading" id="grad1">premium user</h2>
- <div class="login-wrap">
- <div class="input-group input-group-lg">
- <span style="border: none" class="input-group-addon"><i style="width: 15px;" class="fa fa-user"></i></span>
- <input style="border: none" type="text" class="form-control" placeholder="Username" name="Username" autofocus required>
- </div>
- <!--<input type="text" class="form-control" placeholder="Username" name="Username" autofocus required>-->
- <br>
- <div class="input-group input-group-lg">
- <span style="border: none" class="input-group-addon"><i class="fa fa-envelope" style="width: 15px;"></i></span>
- <input style="border: none" type="email" class="form-control" placeholder="Email" name="Email" autofocus required>
- </div>
- <br>
- <div class="input-group input-group-lg">
- <span style="border: none" class="input-group-addon"><i style="width: 15px;" class="fa fa-lock"></i></span>
- <input style="border: none" type="password" class="form-control" placeholder="Password" name="Password" required>
- </div>
- <br>
- <button class="btn btn-theme btn-block" name="btn-signup" type="submit"> REGISTER</button>
- <hr>
- <div class="registration">
- <strong> <a class="" href="index.php">
- Home
- </a></strong>
- |
- <strong><a class="" href="blog.php">
- Blog
- </a></strong>
- </div>
- </div>
- </form>
- </div>
- </div>
- <script src="js/jquery.js"></script>
- <script src="js/bootstrap.min.js"></script>
- <!--BACKSTRETCH-->
- <!-- You can use an image of whatever size. This script will stretch to fit in any screen size.-->
- <script type="text/javascript" src="js/jquery.backstretch.min.js"></script>
- <script>
- $.backstretch("img/paris-large.jpeg", {speed: 500});
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement