Okay, how can I make this work for remote server?
<?php
$source="../crm/data";// THIS WORKS
//$source="http://localhost/crm/data";// THIS DOESN'T
$dest="test_2";
//see if (is_dir("$source/$entry")&&$dest!=="$source/$entry")
copys($source,$dest);
function copys($source,$dest)
{
if (!is_dir($source))
return 0;
if (!is_dir($dest))
{
mkdir($dest);
}
$h=@dir($source);
while (@($entry=$h->read()) !== false)
{
if (($entry!=".")&&($entry!=".."))
{
if (is_dir("$source/$entry")&&$dest!=="$source/$entry")
{
copys("$source/$entry","$dest/$entry");
}
else
{
@copy("$source/$entry","$dest/$entry");
}
}
}
$h->close();
return 1;
}
?>