Bonjour.
Qu'est-ce qui ne va pas dans le code si dessous ?
Quand je lance mon script j'obtient l'affichage suivant :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 $this->url = "http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=" . Dev_id . "&Operation=ItemSearch&ResponseGroup=Medium&SearchIndex=Books&Keywords=green&ItemPage=1"; echo "<br>URL : " . $this->url . "<br>"; $rep = file_get_contents($this->url); $xml = simplexml_load_string($rep); $total = $xml->items->TotalResults; echo "<br>Total : " . $total . "<br>";
URL : http://ecs.amazonaws.com/onca/xml?Se...een&ItemPage=1Puis l'erreur suivante :
(J'ai ajouté les " pour plus de visibilité)Warning: file_get_contents("http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=AKIAJHWJRIV57OXSRXFQ&Operation=ItemSearch&ResponseGroup=Medium&SearchIndex=Books&Keywords=green&ItemPage=1") [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in C:\Program Files (x86)\EasyPHP-5.3.1\www\AmazonResultSet.class.php on line 57
Je pense pas que çela vienne du code,peut etre de mon serveur ou de ma configuration (php.ini) ?
Merci.
Partager