php - Image and comment uploading -
@$file = $_files['image']['tmp_name']; @$image = addslashes(file_get_contents($_files['image']['tmp_name'])); $image_name = addslashes($_files['image']['name']); @$image_size = getimagesize($_files['image']['tmp_name']); $user_post = $_post['string'] $user_post mandatory proceeding while, image uploading not compulsory proceed further, have tried various methods $image_size === false takes account empty image file , wrong image file being upload. cant check if image selected empty or image file selected incorrect separately. does have solution issue? if image upload optionally , want check if user has uploaded image or not can use array part $_files['image']['error'] part gives errorcode of file. when part has value 4 no file has been uploade. can check that, when moving file. src: http://php.net/manual/en/features.file-upload.errors.php i hope wanted. if not please clari...