• //  Then you actually have to declare the functions that will generate the pages/page content.
    function boj_menuexample_settings_page() {
    
      echo "<h1>Settings Page</h1>";
    
    }
    function boj_menuexample_about_page() {
    
      echo "<h1>APPLICATION</h1>";
    
    function displayBook ($resultItems)
    {
    foreach ($resultItems AS $item)
    {
    $title = $item['ProductName'];
    $url = $item['Url'];
    $image = $item['ImageUrlSmall'];
    $authorList = implode($item['Authors'], ", ");
    $price = $item['ListPrice'];
    if ($url != "") echo "<img src=\"$image\" align=\"left\">";
    echo "<a href=\"$url\" title=\" Learn More at Amazon.com\">$title<a><br>";
    echo "Author(s): ". $authorList. "<br>";
    echo "List Price:" . $price;
    echo "<br>";
    }
    }
    
    function runSearchQuery($client, $keywords, $page, $mode , $type='lite')
    
    {
    $params = array(
    'keyword' => $keywords,
    'page' => $page,
    'mode' => $mode,
    'tag' => 'xymalfsentert-20',
    'type' => $type,
    'devtag' => 'AKIAIQ2ZQ6JWDC5LOJLA',
    
    );
    
    $namespace = 'https://soap.amazon.com';
    $action = 'https://soap.amazon.com';
    $method = "KeywordSearchRequest";
    $result = $client->call($methos, array('KeywordSearchRequest' =>$params),
    $namespace, $action);
    
    return $result;
    
    }
    
    <form action="./soap.search.php" method ="get"> ## syntax error #
    <input type="text" name="query">
    <input type="hidden" name="page" value="1">
    <select name="mode">
    
    $modes = array();
    $modes[] = "books";
    
    foreach ($modes as $mode)
    {
    echo "<option value =\"$mode\">$mode</option>";
    }
    </select>
    <input type="submit">
    </form> #syntax error ##
    
    $resultItems = $result['Details'];
    
    switch ($mode)
    {
    case "books":
    displayBook($resultItems);
    break;
    }
    if ($result['TotalPages'] > $page)
    {
    $page++;
    echo "<a href=\"soap.search.php?query&mode&page=$page\"> Next 10 Results</a>";
    }
    
    }
    function boj_menuexample_uninstall_page() {
    
      echo "<h1>Uninstall Page</h1>";
    
    }
    
    ?>

    getting syntax errors also would like the amazon tags on my setting page and be able to get variables into my app.

Viewing 2 replies - 1 through 2 (of 2 total)
  • What are you trying to do?

    Don’t just post code, tell us what you are trying to accomplish, what you are actually seeing (tell us the actual syntax error), and tell us where you are inserting this code.

    Thread Starter xymalf

    (@xymalf)

    The syntax error is in line 79 where the form is. I am trying to write a plugin that call pull data from Amazon and then allow the user to save it as a post with his affiliate ID attached. I am not sure if SOAP is best for this. I don’t know how to pass variables to the Amazon API.
    Ideally I wanted the Amazon settings dev tag and tag on the setting page and the SEARCH parameters keywords , category or the application page.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Syntax error’ is closed to new replies.