This SHD work ... no idea why. When user submits form, uploads the file to ../images/ and writes that file name to a text file. It does not upload the file and it blanks out the txt file which I assume means the upload fails.
$img_name = $_FILES['avatar']['name'];
$upload_file = move_uploaded_file($_FILES['avatar']['tmp_name'], "../images/" . $img_name);
$log_avatar = fopen('../archive/avatar.txt', 'w+');
fwrite($log_avatar, $img_name);
fclose($log_avatar);
header("location:user.php");