-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck.php
More file actions
69 lines (67 loc) · 2.05 KB
/
Copy pathcheck.php
File metadata and controls
69 lines (67 loc) · 2.05 KB
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
64
65
66
67
68
69
<?php
session_start();
$conn = new mysqli('localhost', 'People', '123456', 'main');
if ($conn->connect_error) die($conn->connect_error);
$emailfor = str_replace('.', '', $_SESSION['email']);
$emailfor = str_replace('@', '', $emailfor);
$_GET['id'] = (int)$_GET['id'];
$_GET['id'] = strip_tags($_GET['id']);
$_GET['id'] = htmlspecialchars($_GET['id']);
$_GET['id'] = addslashes($_GET['id']);
if($_GET['id'] == 1) {
$query = 'SELECT * from users WHERE email!="'.$_SESSION['email'].'"';
$result = $conn->query($query);
$rows = $result->num_rows;
$not = 0;
for($j = 0; $j<$rows;$j++) {
$result->data_seek($j);
if($result->fetch_array()['email'] == $_POST['email']) {
$not = 1;
}
}
if($_POST['email'] == $_SESSION['email']) {
$not = 2;
}
if(filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) === false) {
$not = 1;
}
print($not);
}
if($_GET['id'] == 2) {
$query = 'SELECT * from users WHERE login!="'.$_SESSION['login'].'"';
$result = $conn->query($query);
$rows = $result->num_rows;
$not = 0;
for($j = 0; $j<$rows;$j++) {
$result->data_seek($j);
if($result->fetch_array()['login'] == $_POST['login']) {
$not = 1;
}
}
if($_POST['login'] == $_SESSION['login']) {
$not = 2;
}
print($not);
}
if($_GET['id'] == 3) {
$not = 0;
if(file_exists($_POST['sitename'].'.php') || strlen($_POST['sitename'])<4) {
$not = 1;
}
print($not);
}
if($_GET['id'] == 4) {
$not = 0;
if(strlen($_POST['pass'])<=5) {
$not = 1;
}
print($not);
}
if($_GET['id'] == 5) {
$not = 0;
if($_POST['pass'] != $_POST['confpass']) {
$not = 1;
}
print($not);
}
?>