View Single Post
ישן 24-10-08, 20:06   # 12
CodeX
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Oct 2006
הודעות: 172

CodeX לא מחובר  

ציטוט:
נכתב במקור על ידי vadimg88 צפה בהודעה
תגיד קישור מלא בנתיב...ומה השגיאה?
הקוד:

PHP קוד:
<?php 
$fileregex 
"[jpg|jpeg|png|gif]"
$path "/img/avatars/";  
$dir opendir($path); 
$images = array(); 
while (
$file readdir($dir)) 
 if (!
is_dir($dirname.$file) and $file <> ".." and $file <> "."
  if (
preg_match($fileregex,$file)) 
   
array_push($images,$dirname.$file); 
asort($images); 
$rpp 5;  
$ipr 4;  
$image_num count($images); 
$pages ceil($image_num / ($ipr $rpp)); 
$rows 1
if (isset(
$_GET['page'])) $page $_GET['page']; 
else 
$page 1
echo 
"<table>\n    <tr>\n"
for (
$i = ($ipr $rpp) * ($page 1); $i< ($ipr $rpp) * $page$i++) { 
if (
$i >= $image_num) break; 
$imgg $images[$i];
echo 
"        <td>\n            <a href='$imgg'><img height='100' width='100' src='$imgg' /></a>\n        </td>\n"
if(
is_int(($i+1) / $ipr)) 

 echo 
"    </tr>\n    <tr>\n"
 
$rows++; 


echo 
"    </tr>\n</table>\n"
for(
$i 1$i<=$pages;$i++) 
echo 
"<a href=\"?page=$i\">$i</a>\n"
?>
לא פותח לי את התייקיה AVATARS שבIMG

הוא מציג לי את השגיאה:
ציטוט:
Warning: opendir(/img/avatars/) [function.opendir]: failed to open dir: No error in C:\wamp\www\WarezIL\1.php on line 4

Warning: readdir(): supplied argument is not a valid Directory resource in C:\wamp\www\WarezIL\1.php on line 6
  Reply With Quote