Fri, 17 May 2024


Upload Files and Produce HTML Code

By: Nathalie, NetArt Media
Wed, 1 August 2018
Upload Files and Produce HTML Code

I've had quite a few visitors download my Quick Image Code Creator free script, which tells me that it is something that many people find quite useful. That being said, I thought perhaps a short tutorial on how the creator works may be of use to those who visit this site.

This tutorial will cover the very basics of the script, as the version I offer for download has quite a few more features. This should be quite helpful though, providing you with a basic understanding of how this script could work for any file upload.


Above would be an example of the HTML form code you might use for the upload. '$pic_path' represents a textarea box that will show up with the created HTML code inside it, once the file has been uploaded. If no file is uploaded, the textarea doesn't display.

The PHP code is quite simple. You can have this either at the top of the same page as the HTML form or perhaps in a separate processing file. It's up to you.


The image below represents what this script produces after upload.

Of course, you could add any div classes you desire to the textarea code, or whatever else you want. I usually include some Javascript code for selecting and copying the code for even more convenience.

As you can see, this is quite a simple process. It doesn't take much to be able to produce HTML code on the fly, ready to be copied and pasted wherever you like.

I hope this example can be of good use to you.


Category: Web Development
Share this post:



See All Scripts






Subscribe for our newsletter

Receive the latest blog posts direct in your mailbox