Skip to content

Instantly share code, notes, and snippets.

@confusedstudent21
Forked from anonymous/activation.php
Last active July 20, 2016 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save confusedstudent21/410f04991691f485e6c28d1e4050e13a to your computer and use it in GitHub Desktop.
Save confusedstudent21/410f04991691f485e6c28d1e4050e13a to your computer and use it in GitHub Desktop.
<?php
$servername = "localhost";
$dbname = "dbtechnerdzzz";
$user = "";
$password = "";
session_start(); // Starting Session
$error=''; // Variable To Store Error Message
if (isset($_POST['submit'])) {
if (empty($_POST['form-username']) || empty($_POST['form-password'])) {
$error = "Username or Password is invalid";
}
else
{
$connection = mysqli_connect($servername,$user,$password);
if(!$connection){
die("unable to connect".mysqli_query());
}
$db=mysqli_select_db($dbname);
if(!$db)
{
die("unable to connect to database".mysqli_query());
}
// Define $username and $password
$username=$_POST['form-username'];
$password=$_POST['form-password'];
// To protect MySQL injection for Security purpose
$username = stripslashes($username);
$password = stripslashes($password);
$username = mysqli_real_escape_string($username);
$password = mysqli_real_escape_string($password);
// SQL query to fetch information of registerd users and finds user match.
$query = mysqli_query("select * from accounts where Password='$password' AND Username='$username'", $connection);
$rows = mysqli_num_rows($query);
if ($rows == 1) {
$_SESSION['login_user']=$username; // Initializing Session
header("location: profile.php"); // Redirecting To profile Page
} else {
$error = "Username or Password is invalid";
}
mysqli_close($connection); // Closing Connection
header("location: signin.php"); // Redirecting To login Page
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<title>TechGeekzzz</title>
<link rel="stylesheet" type="text/css" href="profile.css">
<script src="profile.js"></script>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-5 toppad pull-right col-md-offset-3 ">
<A href="edit.html" >Edit Profile</A>
<A href="edit.html" >Logout</A>
<br>
<p class=" text-info">May 05,2014,03:00 pm </p>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xs-offset-0 col-sm-offset-0 col-md-offset-3 col-lg-offset-3 toppad" >
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Sheena Kristin A.Eschor</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-3 col-lg-3 " align="center"> <img alt="User Pic" src="http://babyinfoforyou.com/wp-content/uploads/2014/10/avatar-300x300.png" class="img-circle img-responsive"> </div>
<!--<div class="col-xs-10 col-sm-10 hidden-md hidden-lg"> <br>
<dl>
<dt>DEPARTMENT:</dt>
<dd>Administrator</dd>
<dt>HIRE DATE</dt>
<dd>11/12/2013</dd>
<dt>DATE OF BIRTH</dt>
<dd>11/12/2013</dd>
<dt>GENDER</dt>
<dd>Male</dd>
</dl>
</div>-->
<div class=" col-md-9 col-lg-9 ">
<table class="table table-user-information">
<tbody>
<tr>
<td>Department:</td>
<td>Programming</td>
</tr>
<tr>
<td>Hire date:</td>
<td>06/23/2013</td>
</tr>
<tr>
<td>Date of Birth</td>
<td>01/24/1988</td>
</tr>
<tr>
<tr>
<td>Gender</td>
<td>Male</td>
</tr>
<tr>
<td>Home Address</td>
<td>Metro Manila,Philippines</td>
</tr>
<tr>
<td>Email</td>
<td><a href="mailto:info@support.com">info@support.com</a></td>
</tr>
<td>Phone Number</td>
<td>123-4567-890(Landline)<br><br>555-4567-890(Mobile)
</td>
</tr>
</tbody>
</table>
<a href="#" class="btn btn-primary">My Sales Performance</a>
<a href="#" class="btn btn-primary">Team Sales Performance</a>
</div>
</div>
</div>
<div class="panel-footer">
<a data-original-title="Broadcast Message" data-toggle="tooltip" type="button" class="btn btn-sm btn-primary"><i class="glyphicon glyphicon-envelope"></i></a>
<span class="pull-right">
<a href="edit.html" data-original-title="Edit this user" data-toggle="tooltip" type="button" class="btn btn-sm btn-warning"><i class="glyphicon glyphicon-edit"></i></a>
<a data-original-title="Remove this user" data-toggle="tooltip" type="button" class="btn btn-sm btn-danger"><i class="glyphicon glyphicon-remove"></i></a>
</span>
</div>
</div>
</div>
</div>
</div>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Login &amp; Register Templates</title>
<!-- CSS -->
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:400,100,300,500">
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="css/form-elements.css">
<link rel="stylesheet" href="css/style.css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- Favicon and touch icons -->
<link rel="shortcut icon" href="ico/favicon.png">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="ico/apple-touch-icon-57-precomposed.png">
</head>
<body>
<!-- Top content -->
<div class="top-content">
<div class="inner-bg">
<div class="container">
<div class="row">
<div class="col-sm-8 col-sm-offset-2 text">
<h1>Please login or register.</h1>
<div class="description">
<p>
Welcome to the first page of the members section. Please login if you have an account. If your new, please go ahead and sign up. The advantages of having an account are:</br>
<ul>
<li type="square"><i>Ability to create, edit, valid or delete articles.</li>
<li type="square">Ability to comment on articles and upvote or downvote them.</li>
<li type="square">Ability to become a privileged member.</i></li>
</ul>
</p>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-5">
<div class="form-box">
<div class="form-top">
<div class="form-top-left">
<h3>Login to our site</h3>
<p>Enter username and password to log on:</p>
</div>
<div class="form-top-right">
<i class="fa fa-key"></i>
</div>
</div>
<div class="form-bottom">
<form role="form" action="activation.php" method="post" class="login-form">
<div class="form-group">
<label class="sr-only" for="form-username">Username</label>
<input type="text" name="form-username" placeholder="Username..." class="form-username form-control" id="form-username">
</div>
<div class="form-group">
<label class="sr-only" for="form-password">Password</label>
<input type="password" name="form-password" placeholder="Password..." class="form-password form-control" id="form-password">
</div>
<button name="submit" type="submit" class="btn">Sign in!</button>
</form>
</div>
</div>
<div class="social-login">
<h3>Have a nice visit!</h3>
<!--<h3>...or login with:</h3>-->
<div class="social-login-buttons"><!--
<a class="btn btn-link-1 btn-link-1-facebook" href="#">
<i class="fa fa-facebook"></i> Facebook
</a>
<a class="btn btn-link-1 btn-link-1-twitter" href="#">
<i class="fa fa-twitter"></i> Twitter
</a>
<a class="btn btn-link-1 btn-link-1-google-plus" href="#">
<i class="fa fa-google-plus"></i> Google Plus -->
</a>
</div>
</div>
</div>
<div class="col-sm-1 middle-border"></div>
<div class="col-sm-1"></div>
<div class="col-sm-5">
<div class="form-box">
<div class="form-top">
<div class="form-top-left">
<h3>Sign up now</h3>
<p>Fill in the form below to get instant access:</p>
</div>
<div class="form-top-right">
<i class="fa fa-pencil"></i>
</div>
</div>
<div class="form-bottom">
<form role="form" action="activate.php" method="post" class="registration-form">
<div class="form-group">
<label class="sr-only" for="form-first-name">First name</label>
<input type="text" name="form-first-name" placeholder="First name..." class="form-first-name form-control" id="form-first-name">
</div>
<div class="form-group">
<label class="sr-only" for="form-last-name">Last name</label>
<input type="text" name="form-last-name" placeholder="Last name..." class="form-last-name form-control" id="form-last-name">
</div>
<div class="form-group">
<label class="sr-only" for="form-email">Email</label>
<input type="text" name="form-email" placeholder="Email..." class="form-email form-control" id="form-email">
</div>
<div class="form-group">
<label class="sr-only" for="form-about-yourself">About yourself</label>
<textarea name="form-about-yourself" placeholder="About yourself..."
class="form-about-yourself form-control" id="form-about-yourself"></textarea>
</div>
<button type="submit" class="btn">Sign me up!</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Footer -->
<footer>
<div class="container">
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
<div class="footer-border"></div>
<p>&copy; 2016 TechGeekzzz.</p>
</div>
</div>
</div>
</footer>
<!-- Javascript -->
<script src="assets/js/jquery-1.11.1.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/js/scripts.js"></script>
<!--[if lt IE 10]>
<script src="assets/js/placeholder.js"></script>
<![endif]-->
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment