"; $root_element ="homepage"; $xml .= "<$root_element>"; error_reporting(0); require '../include/asset.php'; require '../include/Conn.php'; require '../include/config.php'; $xml.=""; $theUploadFolder="https://images.alarab.com/data/cubes/"; $i=1; $result = mysql_query("SELECT link,cube,ID FROM cubes WHERE corder !=0 ORDER BY corder ASC LIMIT 22"); while($row = mysql_fetch_array($result)){ if($row['link']!=""){ $link="https://www.alarab.com/redirect.php?url=".$row['link']; }else{ $link="https://www.alarab.com/redirect.php?url=http://www.alarab.com/loadads.php?adid={$row['ID']}"; } $xml.=" {$theUploadFolder}{$row['cube']} {$link} "; $i++; } $xml.=""; $xml .= ""; header('Content-type: application/xml'); echo $xml; mysql_close($conn); $fp = fopen($cachefile, 'w'); // save the contents of output buffer to the file fwrite($fp, ob_get_contents()); // close the file fclose($fp); // Send the output to the browser ob_end_flush(); ?>