ballouta Posted October 21, 2008 Share Posted October 21, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/129386-solved-copying-files/ Share on other sites More sharing options...
JasonLewis Posted October 21, 2008 Share Posted October 21, 2008 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"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/129386-solved-copying-files/#findComment-670760 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.