<?php 

$image_width = 250;
$image_height = 250;
$max_size = 100;

$dir = '../';

require_once $dir.'includes/main.php';

$errors = array();

// check login
if(!isset($user_id)){
   $errors[] = LOG_IN;
}

// check image
$errors[] = check_file($_FILES['image'], $max_size, $image_width, $image_height);

// check errors
if(!empty($errors)){

   ex_messages($errors);

}else{

   upload_file($_FILES['image'], 'users', $user_id, 'users');

   ex_redirect("dashboard/edit-account");

}

?>