Bonjour,
j’essaye de récupérer les informations de mon compte sur un site via CURL Mais j'ai des petits problèmes..

Le CURL me r'envoie "404 error" alors que la page existe.

Voici mon code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.boxtoplay.com/fr/login/authenticate');
curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/32.0.1700.107 Chrome/32.0.1700.107 Safari/537.36');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, "login-remember-me=1&emailLogin=".$email."&passwordLogin=".$password);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie-name');  //could be empty, but cause problems on some hosts
curl_setopt($ch, CURLOPT_COOKIEFILE, '/var/www/ip4.x/file/tmp');  //could be empty, but cause problems on some hosts
$answer = curl_exec($ch);
if (curl_error($ch)) {
    echo curl_error($ch);
}else{
	echo $answer;
}
//Jusqu'a la, sa marche.
 
curl_setopt($ch, CURLOPT_URL, 'https://www.boxtoplay.com/en/'); // Ou le fichier que j'essaye d'avoir: www.boxtoplay.com/minecraft/logs/544715
curl_setopt($ch, CURLOPT_POST, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, "");
$answer = curl_exec($ch);
if (curl_error($ch)) {
    echo curl_error($ch);
}else{
	echo $answer; //r'envoie: 404 error
}
Le site: https://www.boxtoplay.com/en/

Je vous remercie d'avance pour vos réponses,

Cordialement.