php - move_uploaded_file() is not working but file is uploaded? -
so i'm trying create code creates , publishes file webroot, modifies , writes file, , change location of file directory/folder using move_uploaded_file()
this code far
$myfile = fopen($_post['title'].".txt", "w"); move_uploaded_file($myfile,'$dir/$title.txt'); fwrite($myfile, $_post['textarea11']); fclose($myfile);
the code doesn't work, i've tried echoing move_uploaded_file()
, returned nothing, file uploaded it's location wasn't changed.
$dir
defined $dir = __dir__.'/../uploads/';
, $title define $title = $_post['title'];
move_uploaded_file() can used if submitting multipart form , want save uploaded file.
what need this: http://php.net/manual/en/function.rename.php
Comments
Post a Comment