je fait mes débuts sur cURL, mais j'Ai deja un petit probleme, je souhaite envoyer un formulaire automatiquement, mais rien ne ce passe, je ne vois pas trop d'Ou cela peu venir si quelqu'un a une idée
<?php
$fp = fopen("cookies.txt",'wb');
fclose($fp);
$postfields = array();
$postfields["action"] = "submit";
$postfields["nom"] = "test";
$postfields["email"] = "[email protected]";
$postfields["message"] = "test";
$url = "http://denis-leo.com/contact.php";
$useragent = "Mozilla/5.0";
$referer = $url;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
curl_close($ch);
echo $result;
?>