-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathprocess.php
135 lines (71 loc) · 1.85 KB
/
process.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?php
require_once("config.php");
$msgg=$_POST['input'];
$msg=strtolower($msgg);
$length=strlen($msg);
$flag=0;
$sql="SELECT * FROM user WHERE input LIKE '$msg%' ";
$send=mysqli_query($con,$sql);
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<style>
.in
{
background-color:rgb(64,128,255);
color:white;
padding:10px;
right:0;
width:130px;
text-align: center;
height:auto;
border-radius: 5px;
margin-left: 120px;
margin-bottom: 5px;
}
.out
{
background-color:rgb(241,240,240);
color:black;
padding:10px;
left:5;
width:130px;
text-align: center;
height:auto;
border-radius: 15px;
}
</style>
<body>
<div class="in">
<?php echo "$msgg"; ?>
</div><br>
<div class="out">
<?php
function make_links_clickable($text){
return preg_replace('!(((f|ht)tp(s)?://)[-a-zA-Zа-яА-Я()0-9@:%_+.~#?&;//=]+)!i', '<br><a href="$1" target="_blank">Click Here</a><br>', $text);
}
while($row=mysqli_fetch_array($send))
{
$flag=1;
$output=$row['output'];
$title=$row['title'];
$result = make_links_clickable($output);
if(!empty($title))
{
echo "<div style=\"margin-top:10px; margin-bottom:5px;background-color:blue;color:white;\"><b>$title</b></div>";
}
echo "$result";
}
if($flag==0)
{
$output="Sorry I have no knowledge of ".$msgg." yet. Type only one keyword without space instead of full sentence. For Emergency Help Call: 01757687942 Or http://ruet.ac.bd";
$result = make_links_clickable($output);
echo "$result";
}
?>
</div><br>
</body>
</html>