Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function split() is deprecated in /home3/vvaswani/public_html/community/columns/trog/article.php on line 101

Deprecated: Function eregi_replace() is deprecated in /home3/vvaswani/sql.php on line 301

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home3/vvaswani/public_html/community/columns/trog/article.php on line 107

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home3/vvaswani/public_html/community/columns/trog/article.php on line 109

Deprecated: Function ereg_replace() is deprecated in /home3/vvaswani/public_html/community/columns/trog/article.php on line 124

Deprecated: Function ereg_replace() is deprecated in /home3/vvaswani/public_html/community/columns/trog/article.php on line 125

Deprecated: Function split() is deprecated in /home3/vvaswani/public_html/community/columns/trog/article.php on line 127

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174
The Melonfire Community - Trog
Logo         Community
  Trog
Services
The Company
Community
Columns
Your Account
Contact Us
 
 
Using Amazon Web Services With PHP And SOAP (part 2)
Add search features, shopping carts and wish lists to your AWS-backed online store.

| Rolling The Stones |

The first - and the simplest - type of search available in AWS is the keyword search, exposed via the KeywordSearchRequest() call. Here's a simple example of how it works:


<?php

// include class
include("nusoap.php");

// create a instance of the SOAP client object
$soapclient = new soapclient("http://soap.amazon.com/schemas2/AmazonWebServices.wsdl";, true);

// set up an array containing input parameters to be
// passed to the remote procedure
$params = array(
              'keyword'     => 'rolling%20stones',
          'page'        => 1,
          'mode'        => 'books',
          'tag'         => 'melonfire-20',
          'type'        => 'lite',
          'devtag'      => 'YOUR-TOKEN-HERE'
);

// create a proxy so that WSDL methods can be accessed directly
$proxy = $soapclient->getProxy();

// invoke the method
$result = $proxy->KeywordSearchRequest($params);

// print the results
print_r($result);
?>


This is functionally similar to the scripts you've seen thus far; the primary difference lies in the call to a new function - KeywordSearchRequest() - and in the different arguments passed to it. The "keyword" argument passed to the function contains the words to be used as search keys in the specified Amazon catalog(s); note that this search term must be URL-encoded before being passed to the function.

Here's sample output from the script above:


Array
(
    [TotalResults] => 163
    [Details] => Array
        (
            [0] => Array
                (
                    [Url] => http://www.amazon.com/exec/obidos/redirect?tag=melonfire-20%26creative=YOUR-TOKEN-HERE%26camp=2025%26link_code=sp1%26path=ASIN/1556523734
                    [Asin] => 1556523734
                    [ProductName] => Nankering With the Rolling Stones
                    [Catalog] => Book
                    [Authors] => Array
                        (
                            [0] => James Phelge
                        )

                    [ReleaseDate] => April, 2000
                    [Manufacturer] => A Cappella Books
                    [ImageUrlSmall] => http://images.amazon.com/images/P/1556523734.01.THUMBZZZ.jpg
                    [ImageUrlMedium] => http://images.amazon.com/images/P/1556523734.01.MZZZZZZZ.jpg
                    [ImageUrlLarge] => http://images.amazon.com/images/P/1556523734.01.LZZZZZZZ.jpg
                    [ListPrice] => $16.95
                    [OurPrice] => $11.87
                    [UsedPrice] => $10.95
                )

   ... snip ...

        )

)


Next, let's see how this can be integrated into the sample store I've been building.


How to do Everything with PHP & MySQL
How to do Everything with PHP & MySQL, the best-selling book by Melonfire, explains how to take full advantage of PHP's built-in support for MySQL and link the results of database queries to Web pages. You'll get full details on PHP programming and MySQL database development, and then you'll learn to use these two cutting-edge technologies together. Easy-to-follow sample applications include a PHP online shopping cart, a MySQL order tracking system, and a PHP/MySQL news publishing system.

Read more, or grab your copy now!


previous page more like this  print this article  next page
 
Search...
 
In trog...
Logging With PHP
Building A Quick-And-Dirty PHP/MySQL Publishing System
Output Buffering With PHP
Date/Time Processing With PHP
Creating Web Calendars With The PEAR Calendar Class
more...
 
In the hitg report...
Crime Scenes
Animal Attraction
Lord Of The Strings
more...
 
In boombox...
Patience - George Michael
Think Tank - Blur
My Private Nation - Train
more...
 
In colophon...
Hostage - Robert Crais
The Dead Heart - Douglas Kennedy
Right As Rain - George Pelecanos
more...
 
In cut!...
American Chai
The Core
Possession
more...
 
Find out how you can use this article on your own Web site!


Copyright © 1998-
Strict Standards: mktime(): You should be using the time() function instead in /home3/vvaswani/public_html/community/columns/trog/article.php on line 731
2017 Melonfire. All rights reserved
Terms and Conditions | Feedback