-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
32 lines (30 loc) · 1003 Bytes
/
Copy pathindex.php
File metadata and controls
32 lines (30 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
session_start();
require 'db.php';
$action = $_POST['action'];
if ($action == NULL){
$action = 'login_page';
}
if ($action == 'login_page') {
header('Location: login.php');
}else if ($action == 'test_user_valid') {
$email = htmlspecialchars($_POST['reg_uname']);
$pass = htmlspecialchars($_POST['reg_password']);
$sql = "select * from accounts where userid='$email' ";
$results = runQuery($sql);
if(count($results)>0){
if($results[0]['password'] == $pass){
$userownid = $results[0]['ID'];
$_SESSION['LAST_ACTIVITY'] = time();
$_SESSION['protected'] = '00';
setcookie('userownid',$userownid);
$url = "Location: agreement.php";
header($url);
}else{
header('Location: badinfo.html');
}
}else{
header('Location: badinfo.html');
}
}
?>