Hi,
Im trying to get files from folder.
This code is working great in my dev machine.the dir variable is actually c:\xampp\...\...
but in the real server this is the path...
How it can be fixed?
thanks in advance
<?php
$dir = $_SERVER['DOCUMENT_ROOT']."\\cisites\\application\\myworld\\public\\images\\myworldgalleries\\";
echo $dir;
///$dir = home/phptalki/public_html\cisites\application\myworld\public\images\myworldgalleries\
if (is_dir($dir)){
if ($dh = opendir($dir)){
while (($file = readdir($dh)) !== false){
$filepath = $dir . DIRECTORY_SEPARATOR . $file;
echo $filepath;
}
closedir($dh);
}
}
}
?>