/
index.php
46 lines (38 loc) · 958 Bytes
/
index.php
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<h1><div align="center">CHECK PLAG</div></h1>
<?php
require 'DB_FUNCTIONS.php';
$db=new DB_FUNCTIONS();
if(isset($_POST['email']) and !empty($_POST['email']) and isset($_POST['password']) and !empty($_POST['password']))
{
$email=$_POST['email'];
$password=$_POST['password'];
$password_encrypted=md5($password);
$a=$db->validUser($email,$password_encrypted);
if($a==true)
{
setcookie('email',$email,time()+86400);
//header("Location:checkplag.php");
}
else
{
echo "invalid email or password";
}
}
else{
if(isset($_POST['email']) and isset($_POST['password']))
{
echo "<strong>ALL FIELDS ARE REQUIRED</strong>";
}
}
?>
<form action="index.php" method="POST">
email<br>
<input type="text" name="email">
<br>
PASSWORD<br>
<input type="password" name="password">
<br><br>
<input type="submit" name="submit">
<br>
</form>
Not a member?<strong><a href="register.php">REGISTER</a></strong>