-
Notifications
You must be signed in to change notification settings - Fork 0
/
report.php
88 lines (58 loc) · 1.92 KB
/
report.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
session_start();
require('include/connection.php');
require('header.php');
$report_inserted=false;
$err=false;
if(isset($_POST['abusivelink']))
{
$uriArray = explode('=', $_POST['abusivelink']); //convert string into array with explode
$id = $uriArray[1]; //Print first array value
$abusivelink=$_POST['abusivelink'];
$comment=$_POST['linkcomment'];
$sql="select * from link_report where abusive_link='$abusivelink'";
$result=mysqli_query($con,$sql);
$num=mysqli_num_rows($result);
if($num<=0)
{
$sql="insert into link_report(abusive_link,comment,user_ip)values('$abusivelink','$comment','192.1.1.1')";
$result=mysqli_query($con,$sql);
$report_inserted=true;
}
else{
$err=true;
}
}
?>
<?php
if($report_inserted==true)
{
echo '<div class="alert alert-success alert-dismissible fade show" role="alert">
<strong>The URL has been sent to us and will be verified soon.</strong>
</div>';
}
if($err==true)
{
echo '<div class="alert alert-danger alert-dismissible fade show" role="alert">
<strong>This url was already reported, we will take action soon!</strong>
</div>';
}
?>
<div class="container my-4 text-center ">
<h1 class="text-center">Abuse report</h1>
<h3 class="text-primary">Report the<span class="text-danger"> suspicious</span> link</h3>
<form action="#" method="post">
<div class="form-group ">
<div class="mb-3 ">
<input type="text" class="form-control text-center" placeholder="Enter suspicious link*" id="abusivelink" name="abusivelink" autofocus required>
</div>
<div class="mb-3">
<textarea class="form-control text-center" id="linkcomment" name="linkcomment" placeholder="Comment"></textarea>
</div>
<button type="submit" class="btn btn-primary">Report</button>
</div>
</form>
</div>
<?php
require('footer.php');
?>