Copy PHP to new directory , possible? -


just learnt how create new directory in server. question possible copy php file new directory created ?

here's come with

    mkdir('/home/user/public_html/ref/' . $cid . "_" . $gid, 0777);    copy('/home/user/public_html/ref/index.php' ,'/home/user/public_html/ref/' . $cid . "_" . $gid); 

you correct use copy() see php docs on copy here.

the example offer is...

<?php   $file = 'example.txt';   $newfile = 'example.txt.bak';    if (!copy($file, $newfile)) {       echo "failed copy $file...\n";   } ?> 

your syntax incorrect 2 argument in copy() needs file name no directory (as in example above). try this.

      mkdir('/home/user/public_html/ref/' . $cid . "_" . $gid, 0777);    copy('/home/user/public_html/ref/index.php' ,'/home/user/public_html/ref/' . $cid . "_" . $gid . '/index.php'); 

Comments

Popular posts from this blog

Why can rails not find a route created by a helper? -

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -