جزاك الله خير ]|[عنيزآوي]|[
العفو Mix4Adv
والله مدري كيف نسيت اضيف اللينكات
التعديل
كود:
<?php
// no cache header
// تم وضع هذا الكود حتى لاتحفظ الصفحه في جهاز الزائر وبالتالي لا تتحدث
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Cache-control: private");
//end
$banner_path = "http://www.yoursite.com/img/";
$banner_img = array("img_1.jpg","img_2.jpg","img_3.jpg","img_4.gif","img_5.gif","img_6.gif");
$img_height = 60;
$img_width = 465;
$banner_link = array("http://www.yoursite.com/link1.html",
"http://www.yoursite.com/link2.html",
"http://www.yoursite.com/link3.html",
"http://www.yoursite.com/link4.html",
"http://www.yoursite.com/link5.html",
"http://www.yoursite.com/link6.html");
$random_num = rand(0, 5);
$full_url = $banner_path.$banner_img[$random_num];
$link_url = $banner_link[$random_num];
echo "<div align='center'><a target='_self' href='".$link_url."'><img border='0' src='$full_url' width='$img_width' height='$img_height' /></a></div>";
?>
مثال عشوائي
كود:
<div align='center'><a target='_self' href='http://www.yoursite.com/link5.html'><img border='0' src='http://www.yoursite.com/img/img_5.gif' width='465' height='60' /></a></div>
طبعا الوصلات ترتيبها مع ترتيب اسم الصور اي اول وصله لاول صوره وهكذا
كود ال iframe
كود:
<div align="center">
<iframe SRC="randombanner.php" NAME="banner_contant" NORESIZE frameborder="no" marginwidth="0" marginheight="0" border="no" target="_self" scrolling="no" height="70" width="470">
</div>
ضعه في تمبليت navbar اما اوله او اخره
لاحظ ان اسم ملف ال php مسمى بـrandombanner.php هنا