السلام عليكم شباب
قبل قترة نزلت درس الاخ محمود عن بلوك الصور بالاجاكس وقد عدلت فيه شوي لكي يعرض اخر 10 صور مضافة الى قاعدة البيانات وعند التنفيذ تعرض اول صورة وبعد 10 ثواني تعرض كل الصور دفعة واحد ارفق لكم الكود مع التنفيذ بعد الرفع على السيرفر
ياريت لو حد يقدر عليها
ترة دوختني والله

هذا الملف الاول index.php
<html>
<head>
<script language="javascript">
function jah_switch(url,target)
{
if (document.getElementById(target).innerHTML != '')
{
document.getElementById(target).innerHTML = '';
}
else
{
jah(url,target);
}
}
function Switch(url,target) {
// native XMLHttpRequest object

if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
req.onreadystatechange = function() {jahDone(target);};
req.open("GET", url, true);
req.send(null);
// IE/Windows ActiveX version
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = function() {jahDone(target);};
req.open("GET", url, true);
req.send();
}
}
}
function jahDone(target) {
// only if req is "loaded"
if (req.readyState == 4) {
// only if "OK"
if (req.status == 200) {
results = req.responseText;
document.getElementById(target).innerHTML = results;
} else {
document.getElementById(target).innerHTML="???:\n" +
req.statusText;
}
}
}
</script>
</head>
<body>
<?php

require('config.php');
echo '<div id="photo_show">';

$get_phos = @mysql_query ("select Car_pic from car order by Car_id desc LIMIT 1") or trigger_error(mysql_error(),E_USER_ERROR);

$phos= @mysql_fetch_array($get_phos);


echo '<img width="200" src="'.$phos['Car_pic'].'" />';
// ????? ??? div ???? ????? ??? ??????
echo '</div>';
"<script>setInterval('Switch(\'photo_show.php\', \'photo_show\');', 10000);</script>";
//echo "<script>setInterval('Switch(\'photo_show.php\', \'photo_show\')', 10000);</script>";
?>
</body>
</html>
================================================== ===
ملف الثاني photo_show


<?php
include('config.php');
$get_phos = @mysql_query ("select Car_pic from car order by Car_id desc LIMIT 1") or trigger_error(mysql_error(),E_USER_ERROR);
while($phos = @mysql_fetch_array($get_phos))
{
echo '<img width="200" src="'.$phos['Car_pic'].'" />';
}
?>
وهذا تنفيذه على السيرفر


http://www.2worldshopping.com/test/slidshow.php