-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcall.php
29 lines (27 loc) · 1.1 KB
/
call.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
<?php
$text = $_GET['text'];
$max = $_GET['max'];
$conn = mysqli_connect('localhost','root','','bot');
$skype='';
$result = mysqli_query($conn,"select * from relation");
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_array($result,MYSQLI_ASSOC)){
if(strpos($text,$row['name'])!==false || strpos($text,$row['relation'])!==false){
if(strpos($text,'&')!==false || strpos($text,'and')!==false || strpos($text,',')!==false || strpos($text,'group')!==false){
if($row['skype']==''){$skype = $skype.';+91'.$row['phone'];}
else{$skype = $skype.';'.$row['skype'];}}
else{
$skype = $row['skype'];
if($skype==''){$skype = '+91'.$row['phone'];}
break;}}
else{$skype='';}
}}
if($skype!=''){
if(strpos($text,'call')!==false){
header('location: skype:'.$skype.'?call');}
else if(strpos($text,'chat')!==false || strpos($text,'skype')!==false){
header('location: skype:'.$skype.'?chat');}}
else{mysqli_query($conn,"insert into message values('cannot find the contact','sent',$max+2)");
header('location: index.php');}
echo $skype;
?>