Why doesn't copy?

Zdravstvuite! There is code:
<?php
require 'connect.php';
$sql_select = "SELECT * FROM users WHERE DATEDIFF(blok, NOW()) = 3";
$result = mysql_query($sql_select);
if (!$result) {
return;
}
while ($row = mysql_fetch_assoc($result)) {

mail($row['email'], 'Warning!!', 'Soon your account will be blocked!', $from);
$file = 'vost.php';
$newfile = "../landing/{$row['login']}/vost.php";

if (!copy($file, $newfile)) ;


}</property-->
br><br> he shall notify the customer by mail about the fact that 3 days prior to the account notice works OK, but the copy, i.e. the second part of the code, copying is not working, why?
June 8th 19 at 16:53
2 answers
June 8th 19 at 16:55
In your condition:
if (!copy($file, $newfile)) ;
Get error message using php.net/manual/ru/function.error-get-last.php and somewhere, print or salaryrate her. And it will be clear what is wrong.
June 8th 19 at 16:57
Function copy() does not copy the files in nonexistent directories.
Before copying the file to the directory, you need to check if there is a directory called $row['login'] and if such a directory yet, create it php.net/manual/ru/function.mkdir.php
And after that you can use copy()

Find more questions by tags PHPWeb Development