-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
63 lines (38 loc) · 1 KB
/
login.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<body>
<?php
/* $_login="test";
$_password="test";
$_SESSION["name"] = array();
$_SESSION["maths"] = array();
$_SESSION["physics"] = array();
if($_login == $_POST['login'] && $_password == $_POST['password']) {
header("location:" . "form4.php");
} else
header("location:" . "index.html"); */
$users = array();
if(!$fp1 =fopen("login.txt","r")){
header("location:" . "index.html");
} else {
while(!feof($fp1)){
if($fp1 == 'Resource id #5'){
break;
}
$ligne = fgets($fp1,200);
if(strlen($ligne)>0){
$users = explode(';',$ligne,2);
if(((strcmp(trim($users[0]),trim($_POST['login']))) == 0) && ((strcmp(trim($users[1]),trim($_POST['password']))) == 0)){
header("location:" . "form4.php");
fclose($fp1);
}
}
}
}
header("location:" . "index.html");
?>
</body>
</html>