Jump to content

XML to PHP product display code help please


mrtc

Recommended Posts

Hello i need help to make a product display page from xml file ....

any one who can help me thanks 

 

i got an xml file products.xml 

 <PRODUCT>
      <PRODUCTS_NAME>Name of the product</PRODUCTS_NAME>
      <PRODUCTS_DESCRIPTION>Details of the products.</PRODUCTS_DESCRIPTION>
      <PRODUCTS_IMAGE>1111.jpg</PRODUCTS_IMAGE>
      <PRODUCTS_PRICE>44$</PRODUCTS_PRICE>
    </PRODUCT>

ok i used this code to get information of all the product name on the page 

<?php
$xml=simplexml_load_file("products.xml") or die("Error: Cannot create object");
foreach($xml->children() as $products) { 
    echo $products->PRODUCTS_NAME. "<br>"; 
} 
?>

its show all product name line by line 

ok so all i want to show full product one by one ... 

For example ( Product image | then product name | Then product price | Then product details )
 

Thanks for your help in advanced 

 

waiting for your answers 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.