Hi The only way i cna think of universally being able to get the price of any amazon product page when a user searches is by using a regular expression. i have no idea how to do this does anyone have any suggetions. thanks
Amazon do an API (which thankfully supports WDSL). Sign up on their website for an ID and you can then dynamically request any information on a product from price to reviews and recommended cross sells
http://docs.amazonwebservices.com/A...5-03-23/ApiReference/ItemSearchOperation.html the above is the search API call however having looked through it you can only search a single area (books, computers etc) in a single call
Put this in a new file called: <? function amazonprice($url){ $data = file_get_contents($url); $before= '<td><b class="price">'; // The text immediately before the text you want $after = '</b>'; // The text immediately after the text you want. // This comments out any special chars in the before or after vars $before = preg_quote($before); $after=preg_quote($after); $match = preg_match($before."(.+?)".$after,$data,$matches); if ($match===FALSE) {echo "Error, text not found.";} else {} }?> PHP: Put this as the FIRST line of your script (AFTER the first <? tag): require_once("inc.amazon.php"); PHP: And now, whenever you want to find the price of an amazon product, assuming you have the url, just do either: This to put it in a variable: $variable = amazon_price("AMAZON URL HERE"); PHP: Or this to print it to screen: echo amazon_price("AMAZON URL HERE"); PHP: Please PM me if you need more help or have more problems.