-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPostRoom.php
54 lines (52 loc) · 1.6 KB
/
PostRoom.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
<?php
include("clans.config.php");
if($_POST['pk'] == "cn"){
if (preg_match('/[^A-Za-z0-9\s-]/', $_POST['value'])){
header('HTTP/1.0 400 Bad Request', true, 400);
echo "الارقام و الحروف الانجليزية فقط !";
}
if(strlen($_POST['value']) >=15){
header('HTTP/1.0 400 Bad Request', true, 400);
echo "اسم الكلان اكثر من 15 حرف";
}
$clan = getClanFromName($_POST['value']);
} elseif($_POST['pk'] == "ct") {
if (preg_match('/[^A-Za-z0-9\s-]/', $_POST['value'])){
header('HTTP/1.0 400 Bad Request', true, 400);
echo "الارقام و الحروف الانجليزية فقط !";
}
if(strlen($_POST['value']) >=5){
header('HTTP/1.0 400 Bad Request', true, 400);
echo "اختصار الكلان اكثر من 5 حروف";
}
$clan = getClanFromTag($_POST['value']);
} else {
if(count(str_split($_POST['value'])) >= 40){
header('HTTP/1.0 400 Bad Request', true, 400);
echo "اسم الروم طويل جدا";
}
}
sleep(1);
$pk = $_POST['pk'];
$name = $_POST['name'];
$value = $_POST['value'];
if(!empty($value)) {
die();
if($pk == "cn"){
if($clan != false){
header('HTTP/1.0 400 Bad Request', true, 400);
echo "اسم الكلان مستخدم";
}
} elseif ($pk == "ct"){
if($clan != false){
header('HTTP/1.0 400 Bad Request', true, 400);
echo "اختصار الكلان مستخدم";
}
} else {
print_r($_POST);
}
} else {
header('HTTP/1.0 400 Bad Request', true, 400);
echo "اكمل الحقل المطلوب !";
}
?>