View Full Version : AWS A Brief Introduction Using PHP tutorial

03-30-2004, 09:20 AM
Dan - or anyone who would know :)

I've been scratching my hand all afternoon on this one.

Using your AWS XML-PHP tutorial (http://www.websitepublisher.net/article/aws-php/) as a guide how would I go about parsing the Authors and Customer reviews into PHP as their another level down in the XML?


<Author>Derek Franklin</Author>
<Author>Jobe Makar</Author>

As per your tutorial im trying the following to set the variable(s):

elseif($d_ar[$j]['tag'] == 'Authors'){
$Authors = $d_ar[$j]['value'];

thanks for your help!

03-30-2004, 10:21 AM
Hey Best.Flash, look closer in the tutorial, for items like author or reviews that could have multiple items the variable you set is an array. For authors, look for the <Author> XML tag (not <Authors>).

elseif($d_ar[$j]['tag'] == 'Author'){
$Author[] = $d_ar[$j]['value'];

foreach($Author as $auth){
echo '<a href="search.php?q=' .$auth. '&t=Author">' .$auth. '</a> ';

03-30-2004, 10:36 AM
Thanks fella :D i see all the codes in the product source file as well.


05-24-2004, 04:24 AM
I tried to use this code in the browse.php script but I have the authors repeated themselves all the time.

result 1
Neil A. Campbell, Jane B. Reece
result 2
Neil A. Campbell, Jane B. Reece, Gerard J. Tortora, Berdell R. Funke, Christine L. Case

and so on.
It must be something like a break or someting but can't find the way to do it.

05-25-2004, 08:47 AM
problem also with the ProductDescription.
If you use use browse.php in heavy mode and add the following line

elseif($d_ar[$j]['tag'] == 'ProductDescription') {$ProductDescription = $d_ar[$j]['value'];}

The ProductDescription appears also in the records where there is no productdescription