Welcome Guest, Not a member yet? Register   Sign In
Get files from folder
#1

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);
}
}
}
?>
Reply


Messages In This Thread
Get files from folder - by eladr - 05-18-2015, 01:35 AM
RE: Get files from folder - by eladr - 05-18-2015, 04:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB