$number_article = 3; $url_title = 'topchef'; $comment_link; if(isset($_GET["token"]) && isset($_GET["id"]) && is_numeric($_GET["token"]) && is_numeric($_GET["id"])){ $check = curl_init(); curl_setopt($check, CURLOPT_URL, "https://socialevent.fr/ntssii/index.php/public/userssiiweb/checkuser/id/".$_GET["id"]."/token/".$_GET["token"]); curl_setopt($check, CURLOPT_RETURNTRANSFER, 1); $outputcheck = curl_exec($check); if($outputcheck == 0){ header('Location: https://notetassii.com/mobile/indexm?deconnexion=true'); } setcookie("token",$_GET["token"]); setcookie("id",$_GET["id"]); } else{ if(isset($_GET["deconnexion"])){ unset($_COOKIE["token"]); unset($_COOKIE["id"]); setcookie('token', NULL, -1); setcookie('id', NULL, -1); } else{ if(is_numeric($_COOKIE["id"]) && is_numeric($_COOKIE["token"])){ if(isset($_GET["search"])){ header('Location: https://notetassii.com/mobile/'.$url_title.'m.php?token='.$_COOKIE["token"].'&id='.$_COOKIE["id"]); }else{ header('Location: https://notetassii.com/mobile/'.$url_title.'m.php?token='.$_COOKIE["token"].'&id='.$_COOKIE["id"]); } } } } if(isset($_POST["commentaire"]) && isset($_POST["username"]) && isset($_POST["pseudo"]) && isset($_POST["password"])) { $pseudo = addcslashes(addslashes($_POST["pseudo"]), '%_'); $username = addcslashes(addslashes($_POST["username"]), '%_'); $password = addcslashes(addslashes($_POST["password"]), '%_'); $commentaire = addcslashes(addslashes($_POST["commentaire"]), '%_'); $url = 'https://socialevent.fr/ntssii/index.php/public/userssiiweb/guestcommentecliche/sujet/'.$number_article.'/token/'.$_GET["token"].'/id/'.$_GET["id"]; $fields = array( 'pseudo' => urlencode($pseudo), 'username' => urlencode($username), 'password' => urlencode($password), 'commentaire' => urlencode($commentaire) ); //url-ify the data for the POST foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } rtrim($fields_string, '&'); //open connection $ch3 = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch3,CURLOPT_URL, $url); curl_setopt($ch3,CURLOPT_POST, count($fields)); curl_setopt($ch3,CURLOPT_POSTFIELDS, $fields_string); //execute post $result3 = curl_exec($ch3); header('Location: https://notetassii.com/mobile/'.$url_title.'m.php?token='.$_COOKIE["token"].'&id='.$_COOKIE["id"]); //close connection curl_close($ch3); } $ch = curl_init(); // set url $urlcliche = "https://socialevent.fr/ntssii/index.php/public/ssiiweb/cliche/sujet/".$number_article."/"; curl_setopt($ch, CURLOPT_URL, $urlcliche); //return the transfer as a string curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // $output contains the output string $output = curl_exec($ch); $comments = json_decode($output); ?>