I need to write code that looks for files ending in .jpg in an uploads directory, and adds them as images to the page. I'm not too sure how to go about doing this.
I've done the form that allows someone to choose a file to upload:
<form method="post" action="image.php" enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file">
<br />
<input type="submit" name="submit" value="Submit">
</form>
I'm also not too sure how to write a PHP script to process the request from the form. I need it to check thath the upload is a valid image, and move it into an appropriate place if it is.