Tutorial: How to make an Image Upload and Thumbnailer Script PHP

Meta: April 08th 2008 // PHP // 13,075 views

5. The last section to this tutorial. After the html form on the same page thumbs.html i added this:

	<img src="&lt;?php echo 'thumbs/'.$filename; ?&gt;" alt="" />
	Link:
<input type="text" value="&lt;?php echo $urltothumbs.$filename; ?&gt;" />

What this does is see if the variable $success is a 1 or a 0; if it is true or false. If it is true, that means the file creation worked and we can display it. So what it does it makes a html img placeholder with the filename in the source. This shows the image on the page nicely. Next up is a simple text field where people can copy the uploaded image’s link and give it to friends.

Pages: 1 2 3 4 5 6 7

WeDecal.com

Postscript: Leave A Comment // Subscribe (RSS Feed)

Comments About Tutorial: How to make an Image Upload and Thumbnailer Script PHP

// 7 comments so far.

  1. paparanch // June 16th 2008

    i don’t whats the problem with this because when i uploaded a gif file…its not animating anymore…why?

  2. pouria // August 07th 2008

    hi :)
    i recive this error with every kind of images :
    File is not an image! Don’t waste my time!

    so whats the problem?

  3. sohn // October 08th 2008

    That’s cool. I test it and it really Great!!

  4. rcarlos3 // February 19th 2009

    i have the same problem as “pouria”,

    with FF its ok, but with IE it doesnt accept the imagees..

    whats the problem?

  5. ehi // March 28th 2009

    can you tell me how i can make a script that will list the uploaded image on a page for other people to use because the page is for site link back images

  6. VoiDeT // March 28th 2009

    Either use a database to reference to the files, or write a directory listing script! :) Plenty of them out there! My other tutorial shows you how to insert into a database also! Thank you

  7. Sudhendu // April 15th 2009

    great work :D

Who Are You?

Your Email Address

Your Website

:D :) :o :eek: :( :lol: :wink: :arrow: :idea: :?: :!: :evil: :p

You can follow any responses to this entry via its RSS comments feed. You may also leave a trackback by clicking this link.