Please someone help me, I get this error : Warning: file_get_contents(http://ecs.amazonaws.com/onca/xml?AWSAccessKeyId=AKIA........&AssociateTag=........-20&Keywords=harry+potter&Operation=ItemSearch&ResponseGroup=ItemAttributes,Offers,Images&SearchIndex=Books&Service=AWSECommerceService&Timestamp=&Version=2010-11-01&Signature=pqNYLF4%2...........PrcLc5U%3D) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in /home/......./SimpleStore.php on line 56 ItemSearch($_GET['SearchIndex'], $_GET['Keywords']); //Set up the operation in the request function ItemSearch($SearchIndex, $Keywords){ //Set the values for some of the parameters. $AWSAccessKeyId = "AKIA------"; $SecretAccessKey = "hH-------"; $AssociateTag = "-------20"; $Operation = "ItemSearch"; $Version = "2010-11-01"; $Service = "AWSECommerceService"; $ResponseGroup = "ItemAttributes,Offers,Images"; $String = "AWSAccessKeyId=$AWSAccessKeyId&AssociateTag=$AssociateTag&Keywords=$Keywords&Operation=$Operation&ResponseGroup=$ResponseGroup&SearchIndex=$SearchIndex&Service=$Service&Timestamp=$Timestamp&Version=$Version"; $String = rawurldecode($Request); $String = str_replace("%7E", "~", $String); $String = preg_replace('/[\r\n\" "]/', '', $String); $String = preg_replace('#Keywords=(.*?)&([A-Za-z]+)=#e', '"Keywords=".preg_replace("/[^0-9a-zA-Z]/"," ","$1")."&".$2."=";', $String); $String = preg_replace('/[" "]+/', ' ', $String); $StringArray = explode( '?', $String, 2); $Parameters = explode("&", $StringArray[1]); $Parameters[] = "Timestamp=" .gmdate("Y-m-d\TH:i:s\Z"); asort($Parameters); $NewString = implode("&", $Parameters); $NewString = rawurlencode($NewString); $NewString = str_replace("~", "%7E", $NewString); $NewString = str_replace("%3D", "=", $NewString); $NewString = str_replace("%26", "&", $NewString); $url = parse_url($StringArray[0]); $PrependString = "GET\n" .$url['host']. "\n" .$url['path']. "\n" .$NewString; $Signature = base64_encode(hash_hmac("sha256", $PrependString, $SecretAccessKey, True)); $Signature = rawurlencode($Signature); $SignedRequest = $StringArray[0]. "?" . $NewString . "&Signature=" .$Signature; //for $SearchIndex and $Keywords $SearchIndex = "Books"; $Keywords = "harry+potter"; //Define the request $request= "http://ecs.amazonaws.com/onca/xml" . "?AWSAccessKeyId=" . $AWSAccessKeyId . "&AssociateTag=" . $AssociateTag . "&Keywords=" . $Keywords . "&Operation=" . $Operation . "&ResponseGroup=" . $ResponseGroup . "&SearchIndex=" . $SearchIndex . "&Service=" . $Service . "&Timestamp=" . $Timestamp . "&Version=" . $Version . "&Signature=" . $Signature; Please tell me what is wrong with this code.
Why do you want to invent the wheel? Download free amazon script, make some money and buy paid script. Make money - don't waste your time.
I know that the free scripts use they amazon associate id sometimes, The one in your signature will use my associate id all the time? and what the best paid script do you recommend me please?
Yes, all the time. It's easy to test. All links to amazon use your associate id only. Associate-o-Matic $99.00 and Associate Store Script $9.95 (PHP or Joomla version - see my signature)
Free version - Category pagination disabled - Your visitors can't purchase all available items and limited to one page per category/subcategory.