Passed
Pull Request — master (#54)
by
unknown
10:59
created

prova.php (1 issue)

Labels
Severity
1
<?php
2
3
$token = 1891640704:AAF3ZxfPZ7xPmAZEtc1UXKC-Lkf_cw2H4Es;
0 ignored issues
show
A parse error occurred: Syntax error, unexpected ':' on line 3 at column 19
Loading history...
4
$website = 'https://api.telegram.org/bot'.$token;
5
$update = file_get_contents('php://input');
6
$update = json_decode($update, TRUE);
7
$message = $update['message']['text'];
8
$id = $update['message']['from']['id'];
9
$name = $update['message']['from']['first_name'];
10
$surname = $update['message']['from']['last_name'];
11
$username = $update['message']['from']['username'];
12
13
sendMessage($id, "ciao, come va? ");
14
15
sendMessage($id, $text){
16
  $url = $GLOBALS[website]."/sendMessage?chat_id=$id&text=".urlencode($text);
17
  file_get_contents($url);
18
}
19
20
?>
21