Home Changing profile picture php

# Changing profile picture php

user2698
1#
user2698 Published in March 22, 2018, 9:11 pm
 I am creating a social network and I am having a couple of problems . When I click the change profile picture the image goes to the destination and then nothing happens . I think there is a max size for the picture that is uploaded . How do I give a statement that tells the user the image is to big ? profile.php: 

Change profile picture:

 upload.php: $target_dir = "images/uploads/";$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $uploadOk = 1;$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); // Check if image file is a actual image or fake image if(isset($_POST["change"])) { move_uploaded_file($_FILES["fileToUpload"]["tmp_name"],$target_file); $sql = "UPDATE users SET userPic = '".$_FILES['fileToUpload']['name']."' WHERE username = '" . $username . "'";$check = $conn->query($sql); if($check !== false) { echo " Profile pciture has been changed " .$check["mime"] . "."; $uploadOk = 1; } else { echo "File is not an image.";$uploadOk = 0; } } else { echo"did not change"; } 
 You need to login account before you can post.
Processed in 0.350865 second(s) , Gzip On .