My Ride
Started: Friday 24th May 2013 7:19am
Distance: 11.32km
Duration: 00:28:08
Rest Time: 00:08:46
Climb: 92m
Max Speed: 45.72kmph
Average Speed: 24.14kmphInstagrams
-
Recent Posts
Recent Comments
- Arie on Tag Time: CakePHP Tag Plugin
- Paul on Sign Me Up A CakePHP User Registration Plugin
- Paul on Sign Me Up A CakePHP User Registration Plugin
- Watch The Big Bang Theory season 6 episode 13 on On My Tv: With Trakt.tv
- veloura et bellagenix on Ultimate Guestbook Tutorial: How to build a Guestbook with a honeypot, error checking, IP banning, pagination, e-mail notification and smilies with PHP and mySQL
Archives
- February 2013
- December 2012
- September 2012
- July 2012
- January 2012
- September 2011
- August 2011
- February 2011
- January 2011
- November 2010
- October 2010
- August 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
Categories
Meta
Tutorial: How to make an Image Upload and Thumbnailer Script PHP
April 8, 2008,
16,635 views
1. Open up your thumb.php file and put this in above the html form:
What this piece of code does is it checks that the form has been submitted, and then checks to see if the uploaded file is of the right format. isset($_POST['submit']) looks to see if the post value of the submit button is present. If it is, then this if statement is valid and the processing will continue.
The next line sets up an array into $acceptedfiletypes variable. Inside the array are MIME type header values. We have added three to this array, all the files that we will allow to be uploaded and handled. They include jpgs, gif, and png. You can name the extension anything you want on the file, but it will only allow the file types in the array.
The third line gets the MIME type of the uploaded file and stores it into a variable for later use. So now the fourth line puts these two parts together. It uses the in_array function to see if the text in the $filetype variable is present in the $acceptedfiletypes array. If it is, i.e. in our case if it is an image, then it will come back as true and the code will continue executing. If not, it will return false and shout back to the user an error, ours is a bit bossy and says don’t waste our time.






7 Comments
i don’t whats the problem with this because when i uploaded a gif file…its not animating anymore…why?
hi
i recive this error with every kind of images :
File is not an image! Don’t waste my time!
so whats the problem?
That’s cool. I test it and it really Great!!
i have the same problem as “pouria”,
with FF its ok, but with IE it doesnt accept the imagees..
whats the problem?
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
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
great work