lundi 26 novembre 2018

Why curl doesn't work with my active session?

I have issue with my feature which I want add to my website.

When I'm trying exec curl, script getting crash (HTTP ERROR 500).

There is something what I don't know about session and curl?

Everything works without session OR withour execute curl.

How I can fix that or where I should look to issue?

<?php 
session_start();

include("include/function.php");

if($_SESSION['logadm']=="adm" or $_SESSION['logmod']=="mod")
{

$link = $_GET['link'];
    $curl = curl_init("https://discordapp.com/api/webhooks/keyyy");
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode(array("content" => "$link", "username" => "webhook")));

curl_exec($curl)

}



header("Location: ".$_SERVER['HTTP_REFERER']."");


?>




Aucun commentaire:

Enregistrer un commentaire