remove db folder and unused files
This commit is contained in:
parent
0a7e39ace1
commit
eb316dc898
|
@ -1,6 +0,0 @@
|
|||
<?php
|
||||
session_start();
|
||||
if(!isset($_SESSION["username"])){
|
||||
header("Location: db/login.php");
|
||||
exit(); }
|
||||
?>
|
|
@ -1,20 +0,0 @@
|
|||
<?php
|
||||
require('db/db.php');
|
||||
include("db/auth.php");
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Dashboard - Secured Page</title>
|
||||
<link rel="stylesheet" href="css/loginstyle.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="form">
|
||||
<p>Dashboard</p>
|
||||
<p>This is another secured page.</p>
|
||||
<p><a href="db/index.php">Home</a></p>
|
||||
<a href="db/logout.php">Logout</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
20
db/index.php
20
db/index.php
|
@ -1,20 +0,0 @@
|
|||
<?php
|
||||
//include auth.php file on all secure pages
|
||||
include("db/auth.php");
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Welcome Home</title>
|
||||
<link rel="stylesheet" href="css/loginstyle.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="form">
|
||||
<p>Welcome <?php echo $_SESSION['username']; ?>!</p>
|
||||
<p>This is secure area.</p>
|
||||
<p><a href="db/dashboard.php">Dashboard</a></p>
|
||||
<a href="db/logout.php">Logout</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
session_start();
|
||||
// Destroying All Sessions
|
||||
if(session_destroy())
|
||||
{
|
||||
// Redirecting To Home Page
|
||||
header("Location: db/login.php");
|
||||
}
|
||||
?>
|
|
@ -1,43 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Registration</title>
|
||||
<link rel="stylesheet" href="css/loginstyle.css" />
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
require('db.php');
|
||||
// If form submitted, insert values into the database.
|
||||
if (isset($_REQUEST['username'])){
|
||||
// removes backslashes
|
||||
$username = stripslashes($_REQUEST['username']);
|
||||
//escapes special characters in a string
|
||||
$username = mysqli_real_escape_string($con,$username);
|
||||
$email = stripslashes($_REQUEST['email']);
|
||||
$email = mysqli_real_escape_string($con,$email);
|
||||
$password = stripslashes($_REQUEST['password']);
|
||||
$password = mysqli_real_escape_string($con,$password);
|
||||
$trn_date = date("Y-m-d H:i:s");
|
||||
$query = "INSERT into `users` (username, password, email, trn_date)
|
||||
VALUES ('$username', '".md5($password)."', '$email', '$trn_date')";
|
||||
$result = mysqli_query($con,$query);
|
||||
if($result){
|
||||
echo "<div class='form'>
|
||||
<h3>You are registered successfully.</h3>
|
||||
<br/>Click here to <a href='db/login.php'>Login</a></div>";
|
||||
}
|
||||
}else{
|
||||
?>
|
||||
<div class="form">
|
||||
<h1>Registration</h1>
|
||||
<form name="registration" action="" method="post">
|
||||
<input type="text" name="username" placeholder="Username" required />
|
||||
<input type="email" name="email" placeholder="Email" required />
|
||||
<input type="password" name="password" placeholder="Password" required />
|
||||
<input type="submit" name="submit" value="Register" />
|
||||
</form>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</body>
|
||||
</html>
|
|
@ -2,6 +2,6 @@
|
|||
echo '<ul>
|
||||
<li><a href="ticket.php">Ticket</a></li>
|
||||
<li><a href="board.php">Board</a></li>
|
||||
<li><a class="active" href="index.php">Home</a></li>
|
||||
<li><a class="active" href="home.php">Home</a></li>
|
||||
</ul>'
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue