I am new to programming and trying to learn php so excuse my ignorance. I am trying to copy a folder to a new folder and I used the script below and I get an error that says
"Parse error: parse error, unexpected '.' in /home/german/public_html/copystats.php on line 14"
What am I doing wrong?
Thanks in advance for your help!
Sarah
<head><title> Copystats</title></head>
<body>
<?php
$from_path=”/home/german/tmp/webalizer”
$to_path=”/home/german/public_html/stats”
function rec_copy ($from_path, $to_path) {
mkdir($to_path, 0777);
$this_path = getcwd();
if (is_dir($from_path)) {
chdir($from_path);
$handle=opendir('.');
while (($file = readdir($handle))!==false) {
if (($file != ".") && ($file != "..")) {
if (is_dir($file)) {
rec_copy ($from_path.$file."/",
$to_path.$file."/");
chdir($from_path);
}
if (is_file($file)){
copy($from_path.$file, $to_path.$file);
}
}
}
closedir($handle);
}
}
?>
</body>