Example #1
0
        ?>
</option>
                            <?php 
    }
}
?>
                </select>
            </label>
            <input type="submit" value="Search!">
        </p>
    </form>
<?php 
if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') {
    $amazon = new Query("1338XJTNFMTHK413WFR2");
    try {
        $amazon->category($searchFor)->ResponseGroup('Large')->Keywords($keywords);
        $results = $amazon->search();
        if ($results->totalResults() > 0) {
            echo '<div id="results">';
            echo '<h2>Search Results</h2>';
            foreach ($results as $result) {
                echo "<div>";
                echo "<h3>{$result->Title}</h3>";
                if (isset($result->MediumImage)) {
                    ?>
                        <div class="thumb">
                            <a href='<?php 
                    echo $result->DetailPageURL;
                    ?>
' title='<?php 
                    echo $result->Title;