You are here : Home - Web Development - DHTML
DHTML
include_once('config.php');
$input="497024";
$mode="books";
$todayday = strftime ("%A");
//$todayday = "Friday";
if($todayday == "Monday"){$input="295223";$thesec = "PHP";} // ASP
if($todayday == "Tuesday"){$input="3617";$thesec = "JavaScript";} // JavaScript
if($todayday == "Wednesday"){$input="Hypertext Mark-Up Language";$thesec = "HTML";} // HTML
if($todayday == "Thursday"){$input="285847";$thesec = "Microsoft";} // Microsoft
if($todayday == "Friday"){$input="3849"; $thesec = "Linux";} // Linux
if($todayday == "Saturday"){$input="3759";$thesec = "Mac OS";} // Mac
if($todayday == "Sunday"){$input="3527";$thesec = "Photoshop";} // Photoshop
if(!$mode){
$mode="books";
}
if($mode == "ebooks"){$mode="books";$newmode="ebooks";}
$page=1;
$amazonAPI->setSearchType("lite");
$xml = $amazonAPI->browseNodeSearch($input,$mode);
$amazon = new AmazonLiteXMLParser($xml);
$x=0;
if(!is_array($amazon->records)) {
'Error!';
exit;
}
if(isset($amazon->errorMsg)) {
echo "
{$amazon->errorMsg}";
exit;
}
$cachedir = "cache/";
$cachetime = 30;
$thefilename = $todayday.".xml";
$cachepath="store/";
$thefile=$cachepath.$thefilename;
//$thefile= $cachedir.$cachefile;
if($mode == "ebooks"){$mode="books";$newmode="ebooks";}
$page=1;
$amazonAPI->setSearchType("lite");
if(file_exists($thefile) && time()-filemtime($thefile)<$cachetime*60){
$xml = implode('', file($thefile));
}
else
{$savetocache=1;}
if($savetocache){
$xml = $amazonAPI->browseNodeSearch($input,$mode);
$cf = fopen($thefile,"w+");
fwrite($cf,$xml);
fclose($cf);
}
$amazon = new AmazonLiteXMLParser($xml);
$x=0;
if(!is_array($amazon->records)) {
'Error!';
exit;
}
if(isset($amazon->errorMsg)) {
echo "
{$amazon->errorMsg}";
exit;
}
?>
|
foreach($amazon->records as $ind => $arr) {
$arr['productname'] = preg_replace("/(.*\/sup>)/","TM",$arr['productname']);
$x++;
if ($x <= 5){
//if($x==1 || $x==4){echo "";}
?>
|
|
//if($x==3 || $x==6){echo "";}
}
}
?>
|
Dynamic HTML (DHTML) allows you more control over how your webpages display. A combination of HTML, JavaScript and style sheets means you can now bring your webpages to life - without additional software.
Have you got any DHTML tips or guides you'd like to share with others? Find out how you can help.