PDA

View Full Version : What's Wrong With My Product Page?



incka
01-31-2004, 03:45 PM
What's wrong with this page?

http://www.nichetimbers.co.uk/jewelrystore/product/B0000AOX2N


This is my code:


<?php

$var_array = explode("/",$PATH_INFO);
$asin = $var_array[3];

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

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

// uncomment the next line to see debug messages
// $soapclient->debug_flag = 1;

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

// set up an array containing input parameters to be
// passed to the remote procedure
$params = array(
'asin' => sprintf("%010d", $_GET['asin']),
'tag' => 'games2go-20',
'type' => 'heavy',
'devtag' => 'D6Y8R22P5D1FJ'
);

// invoke the method
$result = $proxy->ASINSearchRequest($params);
$items = $result['Details'];

// display the result
?>

<html>
<head>
<title>Jewelry Store - Buy-Jewelry.net - Fine Jewelry - <? echo $items[0]['ProductName']; ?></title>
<basefont face="Verdana">
</head>

<body bgcolor="white" topmargin="0" rightmargin="0" leftmargin="0">
<table>
<tr>
<td>
<img src="images/topleft.jpg" border="0" />
</td>
<td>
<img src="images/topright.gif" border="0" />
</td>
</tr>
<tr>
<td valign="top">
<TABLE BORDER="0" WIDTH="100%" CELLSPACING="0" CELLPADDING="0">
<TR BGCOLOR="#00639C">
<TD HEIGHT="14" CLASS="infoBoxHeading" valign="top"><IMG SRC="images/topleftmenu.gif" BORDER="0" alt="" WIDTH="11" HEIGHT="14"></TD>
<TD WIDTH="100%" HEIGHT="14" CLASS="infoBoxHeading" > <font color="#ffe82d"><b>Jewelry Menu</b></font></TD>
<TD HEIGHT="14" CLASS="infoBoxHeading" nowrap><IMG SRC="images/toprightmenu.gif" BORDER="0" alt="" WIDTH="11" HEIGHT="14"></TD>
</TR>
</TABLE>
<TABLE BORDER="0" WIDTH="100%" CELLSPACING="0" CELLPADDING="1" CLASS="infoBox" BGCOLOR="b6b7cb">
<TR>
<TD><TABLE BORDER="0" WIDTH="100%" CELLSPACING="0" CELLPADDING="3" CLASS="infoBoxContents" BGCOLOR="f8f8f9">
<TR>
<TD VALIGN="top" CLASS="boxText">
<?php include("menu.inc"); ?>

</TD>
</TR>
<TR>
<TD><IMG SRC="images/toprightmenu.gif" BORDER="0" alt="" WIDTH="100%" HEIGHT="1"></TD>
</TR>
</TABLE>
</td>
</tr>
</table>
</td>
<td valign="top">


<table width="100%" border="0" cellspacing="5" cellpadding="0"> <tr> <td
align="center" valign="top" rowspan="7"><a href="<? echo
$items[0]['Url']; ?>"><img border="0" src=<? echo
$items[0]['ImageUrlLarge']; ?>></a></td></tr><tr> <td><font size="-1"><b><? echo
$items[0]['ProductName']; ?></b> / <? echo implode(", ",
$items[0]['Authors']); ?></font></td> </tr> <tr> <td align="left"
valign="top"><font size="-1">List Price: <? echo $items[0]['ListPrice'];
?></font></td> </tr> <tr> <td align="left" valign="top"><font
size="-1">Amazon.com Price: <? echo $items[0]['OurPrice'];
?></font></td> </tr> <tr> <td align="left" valign="top"><font
size="-1">Publisher: <? echo $items[0]['Manufacturer']; ?></font></td>
</tr> <tr> <td align="left" valign="top"><font size="-1">Availability:
<? echo $items[0]['Availability']; ?></font></td> </tr> <tr> <td
align="left" valign="top"><font size="-1">Amazon.com sales rank: <? echo
$items[0]['SalesRank']; ?></font></td> </tr> <tr> <td align="left"
valign="top"><font size="-1">Average customer rating: <? echo
$items[0]['Reviews']['AvgCustomerRating']; ?></font></td> </tr> <tr> <td
colspan="2"> <font size="-1"> <hr> <?
foreach($items[0]['Reviews']['CustomerReviews'] as $r)
{
?>
<b><? echo $r['Summary']; ?></b>
<br>
<? echo $r['Comment']; ?>
<hr>
<?
}
?>
</font>
</td>
</tr>
</table>

</td>
</tr>
</table>

<font size="-1">
Disclaimer: All product data on this page belongs to Amazon.com. No
guarantees are made as to accuracy of prices and information. YMMV!
</font>

</body>
</html>

MattM
01-31-2004, 04:21 PM
Instead of:

'asin' => sprintf("%010d", $_GET['asin']),
use:

'asin' => $asin,

Mike
02-01-2004, 01:48 AM
I really don't know why they give you the sprint method in the devshed tutorial. It did give a reason, but I've never had any problems with using what Matt said.

chromate
02-01-2004, 04:36 AM
I think it was a work-around to combat some old bug with AWS that's been fixed now.

incka
02-01-2004, 07:21 AM
Still doesn't work.

chromate
02-01-2004, 08:43 AM
You shouldn't be using $_GET[asin] at all. Remember you're using search engine friendly URL's now, so using the standard $_GET will no longer work because the variable doesn't appear that way in your URL.

All you need to so is use $asin, because you've already set it at the top of your code.

incka
02-01-2004, 10:11 AM
Still having problems with line 93.

Line's 92 - 94 are:


colspan="2"> <font size="-1"> <hr> <?
foreach($items[0]['Reviews']['CustomerReviews'] as $r)
{

chromate
02-01-2004, 10:47 AM
What're the error you're getting?

do print_r($items) to make sure the array actually has some Reviews to iterate over.

MattM
02-01-2004, 02:15 PM
Yeah, is it a parse error or something else?