Image Upload System

Features:

  • Users upload profile pictures.
  • PHP checks file type/size.
  • Stores image in /uploads folder.
<?php
if(isset($_FILES['file'])){
$target = "uploads/" . basename($_FILES&#91;'file']&#91;'name']);
if(move_uploaded_file($_FILES&#91;'file']&#91;'tmp_name'], $target)){
    echo "File uploaded!";
} else {
    echo "Upload failed!";
}
} ?> <form method="post" enctype="multipart/form-data"> <input type="file" name="file"> <input type="submit" value="Upload"> </form>

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *