View Full Version : custom function help please.

12-16-2008, 03:43 PM

i have created a function

function amazonfeed (){

// How many items to display from the RSS Feed ...
$count = 1;

foreach ($xml->product as $item) {

if ($item->shippingCost == '0'){
$shipping = "Free";
else {
$shipping = "{$item->shippingCost}";

$date = rtrim($item->fields->Release_Date," 00:00:00");

if($count > 0){

<a href='{$item->deepLink}'>{$item->productname}</a><br />
<a href='{$item->deepLink}'><img src='{$item->imageURL}' alt='{$item->productname}' height='100' border='0' vspace='10'/></a>

<div class='feedcontainer_yellow'>
<div class='feeditems_platform_review'><b>Name</b><br>{$item->productname}</div>
<div class='feeditems_platform_review'><b>Availability</b><br>{$item->availability}</div>

<div class='feedcontainer_pink'>
<div class='feeditems_prices'><b>Price</b><br />
<div class='feeditems_prices'><b>Shipping Costs</b><br />
<div class='feeditems_prices'><b>Release Date</b><br />


which is stored in functions.php

and have used this line on the webpages where i want to use the function to include the functions.php page

<?php require('functions.php'); ?>

an example of me calling the function

elseif ($feedID[$i] == '3'){

but i am getting an error:

Parse error: syntax error, unexpected '}' in /customers/kernow-connect.com/kernow-connect.com/httpd.www/affiliate/clothing.php on line 337

and im not sure why. can anyone please help

12-16-2008, 04:01 PM
Each expression/function call/whatever needs to be terminated with a semi-colon.

12-16-2008, 04:04 PM
cool thank you :)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum