Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

how do you Embed/import a URL(xml feed) in to a page/iframe


Guest

Recommended Posts

Posted

Also - how do you import / embed a url with is the container for an xml feed - an sure is asked a million times here. but i just cant find out how to do it.

 

i have the chance to xml feed -for products and i want to embed them in my site, and only have to update the url every week ( there is the oppotunity to get this feed and upload this to the database, but i have tried many times and i just cant get past syntax error 1064 from MYSQL database using MYPHPadmin - i am really flummocked on that, so i moved to option B)

so!

this was the original php code i used

<?php

// URL of the XML feed.
$feed = 'http://feeds.omgeu.com/data/feed.aspx?hash=25db7ffc1f43476e88cb18bbe11fed65&page=1&rows=10';

// How many items do we want to display?
$display = 9;

// Check our XML file exists
if(!file_exists($feed))
{
 die('The XML file could not be found!');
}

// First, open the XML file.
$xml = simplexml_load_file($feed);

// Set the counter for counting how many items we've displayed.
$counter = 0;

// Start the loop to display each item.
foreach($xml->post as $post)
{
 echo '<h1>' . $post->title . '</h1>
 <em>Written by ' . $post->author . ' on ' . $post->date . ' at ' . $post->time . '</em>
 <p>
 ' . $post->content . '
 </p>';
 // Increase the counter by one.
 $counter++;
 // Check to display all the items we want to.
 if($counter == $display)
 {
// Yes. End the loop.
break;
 }
 // No. Continue.
}

but as always this didnt work... my allow_url_fopen is open, which i believe it needs to be - but i cant get it to work, yet i can open this link from the TESTlink given by the website and it work wonderfully and shows the all products etc etc... yet it doesnt on this php program or if i embed it in a iframe (oh how do you get rid the container wraps??? i know you can do this i have seen it)

 

if someone has a better idea on how to embed that link (yes the link is good and live - i really want to be start this working properly - OR has an idea what i can try on the MYSQL/MYPHPadmin side please fire away.

 

thank you

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...