From the course: PHP Techniques: Working with Files and Directories
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Solution: Profile photos - PHP Tutorial
From the course: PHP Techniques: Working with Files and Directories
Solution: Profile photos
(upbeat music) - [Instructor] I hope that you were able to complete the profile photo challenge assignment. If not, don't worry. And this movie I'm going to walk you through the solution that I came up with. For this challenge assignment we didn't need to make any changes to the profile.PHP page that I created before. All it's doing is displaying an image if it exists, and not displaying, if it doesn't exist. All the work is really being done on upload photo .PHP. We have the form that we needed to fill in correctly which is down here. Let's take a look at that. We had a form, we already had an action for it. It uploads to itself, and you can see that the method needs to be set to post, and the ink type must be set to multi-part/form-data. Then I included a hidden file type for max_file_size which told it to make the value about a megabyte. That's a little bit smaller than a megabyte but it's close enough to use a…