php - Undefined index when uploading image -
i trying create form user upload image using php.
here input file:
<form action="" method="post" enctype="multipart/form-data"> <input type="file" name="imagetoupload" id="imagetoupload"> </form> here php code:
<?php $file_up_size = $_files["imagetoupload"]["size"]; ?> error -> notice: undefined index: imagetoupload ...
check if form sent, work variable.
if (isset($_files["imagetoupload"])) { $file_up_size = $_files["imagetoupload"]["size"]; }
Comments
Post a Comment