Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

Syntax error in code forms.

General discussions related to php

Moderators: macek, egami, gesf

Syntax error in code forms.

Postby xymalf99 » Mon Jun 30, 2014 1:38 pm

Code: Select all
//  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\">$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-',
'type' => $type,
'devtag' => 'AKIAIQ2ZQ6',


$namespace = '';
$action = '';
$method = "KeywordSearchRequest";
$result = $client->call($methos, array('KeywordSearchRequest' =>$params),
$namespace, $action);

return $result;


<form action="./" method ="get">  ## syntax error here ##
<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>";
<input type="submit">
</form> ## syntax error here ##

$resultItems = $result['Details'];

switch ($mode)
case "books":
if ($result['TotalPages'] > $page)
echo "<a href=\"$page\"> Next 10 Results</a>";

function boj_menuexample_uninstall_page() {

  echo "<h1>Uninstall Page</h1>";



I am trying to develop a Wordpress Plugin but so far have hit a brick wall as it is saying syntax error where my Form code is. Also ideally I want to store the Amazon Affiliate tag and Access key on my settings page and then have the Application get these settings. Any idea what the syntax error is? How can I store users setting on the settings page but then use them? Is using SOAP the best way to access Amazon API as ideally I want to store the results in a table that the user can use in a wordpress post with his Affiliate ID attached to a buy now button. :o
New php-forum User
New php-forum User
Posts: 1
Joined: Mon Jun 30, 2014 1:30 pm

Return to PHP General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.