Jump to content

[SOLVED] Copying Files


ballouta

Recommended Posts

Hello

 

is it possible to combine those two lines in one command?

 

<?php
if (!copy("/home/wwwrpld/public_html/$myf", "/home/wwwrpld/stk/$user/$myf")) { echo "failed to copy $myf...\n"; }
if (!copy("/home/wwwrpld/public_html/$myf", "/home/wwwrpld/public_html/back/dct4/$myf-$user")) { echo "failed to copy $myf...\n"; }
?>

thank you

Link to comment
https://forums.phpfreaks.com/topic/129386-solved-copying-files/
Share on other sites

Sure, you could separate with an || in the first statement.

 

<?php
if (!copy("/home/wwwrpld/public_html/$myf", "/home/wwwrpld/stk/$user/$myf") || !copy("/home/wwwrpld/public_html/$myf", "/home/wwwrpld/public_html/back/dct4/$myf-$user")) { echo "failed to copy $myf...\n"; }
?>

Link to comment
https://forums.phpfreaks.com/topic/129386-solved-copying-files/#findComment-670760
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.