Add your company details to our Business Directory, for FREE!


Graphic Design Forums: UK forums for graphic designers » Website Design Forums: » Website Coding & Programming Forum: » Best way to diplay PHP/API feed without iframe?

Reply
Old 03-30-2010, 07:50 PM   #1
Member
 
keith115's Avatar
 
Join Date: Mar 2010
Location: Yorkshire
Posts: 30
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to keith115
Default Best way to diplay PHP/API feed without iframe?

As the title says, i have got an API feed in PHP and im currently showing it in an iframe across the site, yes i know its not best practice, im now looking to get rid of the iframes due to some people not been able to see it and slows the page load.

Any suggestions?

Thank you
keith115 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Twit this!
Reply With Quote
Old 03-31-2010, 12:51 PM   #2
Senior Member
 
creatabledesign's Avatar
 
Join Date: Mar 2010
Location: Swindon
Posts: 137
Thanks: 9
Thanked 15 Times in 14 Posts
Default

Quote:
Originally Posted by keith115 View Post
As the title says, i have got an API feed in PHP and im currently showing it in an iframe across the site, yes i know its not best practice, im now looking to get rid of the iframes due to some people not been able to see it and slows the page load.

Any suggestions?

Thank you
You could potentially place it within a div which has a set height with an overflow so that it's scrollable but it may or may not work in ie6. Just an idea though as it certainly get's rid of the iframe.

Jonathan
creatabledesign is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Twit this!
Reply With Quote
Old 03-31-2010, 02:49 PM   #3
Member
 
keith115's Avatar
 
Join Date: Mar 2010
Location: Yorkshire
Posts: 30
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to keith115
Default

Hi, thanks for the reply, i will post what i have been asked on another forum that may help better

this is basically the php that i then show on site by iframe as a banner.

Code:
PHP Code: <?
$affiliateid = '........'; //Letters and numbers
$trackingid = '.........'; //numbers only
function UrlSigner($urlDomain, $urlPath, $partner, $key){
settype($urlDomain, 'String');
settype($urlPath, 'String');
settype($partner, 'String');
settype($key, 'String');
$URL_sig = "hash";
$URL_ts = "timestamp";
$URL_partner = "aid";
$URLreturn = "";
$URLtmp = "";
$s = "";
$time = time();
$urlPath = str_replace(" ", "+", $urlPath);
$URLtmp = $urlPath . "&" . $URL_partner . "=" . $partner . "&" . $URL_ts . "=" . $time;
$s = $urlPath . "&" . $URL_partner . "=" . $partner . "&" . $URL_ts . "=" . $time . $key;
$tokken = "";
$tokken = base64_encode(pack('H*', md5($s)));
$tokken = str_replace(array("+", "/", "="), array(".", "_", "-"), $tokken);
$URLreturn = $urlDomain . $URLtmp . "&" . $URL_sig . "=" . $tokken;
return $URLreturn;
}
$request = simplexml_load_file(UrlSigner('http://uk.shoppingapis.kelkoo.com', '/V2/productSearch?query=ipod&show_products=1&show_subcategories=0&show_refinements=0&logicalType=and&start=1&results=6&merchantId=', $trackingid, $affiliateid));

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Kelkoo iPod Banner Example</title>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
-->
</style></head>

<body>

<table width="960" border="1" cellpadding="5"><tr>
<?
foreach ($request->Products->Product as $details) {
$ProductName = $details->Offer->ProductName;
$GridImage = $details->Offer->GridImage->Url;
$Price = $details->Offer->Price;
$Url = $details->Offer->Url;

echo '<td width="160" valign="top" style="border:0;"><a href="'.$Url.'"><img src="'.$GridImage.'" style="float:left;border:0; margin-right:1px;" alt="'.$ProductName.'" title="'.$ProductName.'" height="90" width="90"/></a>'.$ProductName.'<br /><span style="color:#FF0000; font-weight:bold;">&pound;'.$Price.'</span></td>';
}


//echo '<pre>';
//print_r($request);
//echo '</pre>';
?></tr></table>

</body>
</html>
keith115 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Twit this!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Flyer Printing | Print Reseller Scheme | Graphic Design | Logo Designer | Web Design UK | Graphic Design UK | Letterhead Printing
Business Card Printing | UK Business Forum | Logo Designer | NCR Pads | NCR Books | Receipt Books | Drinks Coasters | A6 Flyers | A5 Leaflets
Web Design & Development | vBulletin Skins | Small Business Websites | Leaflets | Leaflet Printing | Web Design Liverpool | Invoice Books


DISCLAIMER: All posts on this forum express the views and opinions of the author only, not the owners, staff or advertisers, hence we will not be held liable.


Powered by vBulletin®
© Copyright Jelsoft Enterprises Ltd
SEO by vBSEO 3.2.0 RC5 ©2008, Crawlability, Inc.