so i have
<?php
ob_start();
session_start();
?>
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="file"><br><br>
<input type="submit" value="Upload">
</form>
<?php
$file_name = $_FILES['file']['name'];
$file_size = $_FILES['file']['size'];
$file_type = $_FILES['file']['type'];
$tmp_name = $_FILES['file']['tmp_name'];
$error = $_FILES['file']['error'];
if (isset($file_name)) {
if (!empty($file_name)) {
$location = '/user/'.$_SESSION['Username'].'/';
if (move_uploaded_file($tmp_name, $location.$file_name)) {
echo 'Uploadat!';
}
} else {
echo 'Te rugam alege o imagine!';
}
}
?>
and is not working it says "Unable to move '/tmp/phppQNtB5' to '/user/axxxA/back_view.jpg' in /home/user/public_html/user/axxxA/upload.php on line 20"