Tutorial

Image upload and delete

Images are widely used accross the board from Company's logo, product images, and expense claim receipts. Images are limited by the format type, and the size of the image. The programme need to identify the image files before upload them to the server.
This tutorial shows you the source code how to handle the image upload and delete.

Program flow chart

Webpage generated from the code.

Item text file.

In text-base database, every text file is a record or data. In the record, the sequence of the text in the lines are the database structure how the program read the file. In this example. the very first line is the item name, follow by description, then image file path. All subsequence program has to follow the structure to read the file.

Functions used in this webpage:

PHP

$_FILES[] function
$_POST[] function
trim() function
if statement
fopen() function
fclose() function
fwrite() function
fgets() function
echo function

HTML

HTML Forms

Coding area: