Тёмный

65: How to Create a PHP Gallery Part 3 | Upload & Display Image on Website Using PHP | PHP Tutorial 

Dani Krossing
Подписаться 481 тыс.
Просмотров 72 тыс.
50% 1

In this PHP tutorial you will learn how to create a simple PHP gallery that allow for you to upload images to your website folder. In this way we can create a dynamic image gallery on our website.
In this part 3 video we will finish creating the PHP code which will upload and display images on your website.
RELATED LESSONS:
Download Images Here: www.pexels.com/
Prepared Statements: • 40: What are Prepared ...
CSS Flexbox: • CSS Flexbox Tutorial |...
PHP Login System: • Video
PHP File Upload: • 51: Upload Files and I...
Meet Daniel: another Full-Stack developer who can teach you coding fast and free :D
/ @danielsimionescu298
➤ GET ACCESS TO MY LESSON MATERIAL HERE!
First of all, thank you for all the support you have given me!
I am really glad to have such an awesome community on my channel. It motivates me to continue creating and uploading content! So thank you!
I am now using Patreon to share improved and updated lesson material, and for a small fee you can access all the material. I have worked hard, and done my best to help you understand what I teach.
I hope you will find it helpful :)
Material for this lesson: / lesson-material-42361704

Опубликовано:

 

11 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 240   
@APerson-mu5lr
@APerson-mu5lr 5 лет назад
I really like that you leave in your mistakes. Definitely shows the process in an accurate way and helps me not feel so bad.
@Stoney_Eagle
@Stoney_Eagle 6 лет назад
Glad you cut the video in 3 parts. Makes it easier to swallow 😂 This is a very useful script that I can make good use of. Thanks!
@JamesOkelloOkowa
@JamesOkelloOkowa 5 лет назад
I just wish to express my gratitude for your videos. I've learned so much already. Previously I have sought the help of tutorials and other videos without any apparent success. I'm now poised to complete my web application project. Thank you so much.....
@XJerome124
@XJerome124 5 лет назад
Man, I just made to the end of this playlist, I thought I would never manage to do it, I learnt lots about programming in general, keep up all this good work of yours, regards from Colombia.
@7us
@7us 3 года назад
Just made it through the playlist. You're my HERO ☺
@derekc.gorman595
@derekc.gorman595 3 года назад
I know this video is old so you might not read this comment but I just want to say THANK YOU! I am working on a web app for college and I wanted to learn PHP to be able to upload music and album art. This video series was so well explained I was able to go from 0 PHP experience to actually being able to upload files and display the album art and play the music while I click it. I was able to take what you were talking about and apply it to upload 2 files at the same time (The album art and mp3 audio.) really making it my own. You are amazing and just earned another subscriber!
@akashgola2153
@akashgola2153 5 месяцев назад
wow awesome hearing that , So Did u continue learning PHP, What do u think the status of PHP in the market these days, is it still worth it? Also how u doing in life now, got any job yet?
@shayanfaghihi
@shayanfaghihi 4 года назад
I was searching for a real-life cookie project using PHP when I noticed your channel. You're such a wow! I'm so motivated keeping through your amazing videos. Thanks buddy. Go on making such these great courses.
@AmmarTaicho
@AmmarTaicho 5 лет назад
Dude, you and Traversy Media are the best on this planet. Thank you!!
@ashokchhetri
@ashokchhetri 6 лет назад
Thanks dude... You are a savior. I love how you dnt get bore when explaining the same code over and over in every episodes. Great videos to practice alone for beginners as me. Thank you so much.
@bloografix
@bloografix 2 года назад
Excellent material! Do you have an ecommerce series? It would be great to see what approach you take in such scenario.
@movine2344
@movine2344 6 лет назад
OMG i finally finished your whole videos tutorial now im going to back-end interview
@hahabobblehead2059
@hahabobblehead2059 5 лет назад
did you get the job?
@MrFudgeYT
@MrFudgeYT 4 года назад
Did you get a job?
@nur1739
@nur1739 3 года назад
she/he was probably kidding :d
@CivicYt
@CivicYt 2 года назад
Please make a tutorial on how to do this but with multiple images from a file input with the attribute "multiple" set. Then link every image to the post id (Like a portfolio page showing your images in that portfolio item). Thank you for this tho!
@alinaghale9576
@alinaghale9576 4 года назад
Just completed all 65 tutorials. Great content. Thank you for making such amazing content. More power to you. :)
@george6546
@george6546 4 года назад
Did you get this working? I paid for the patreon to download the files but it isn't working. If you are able to send me the files please let me know - I can provide proof that I am a member of the patreon and that I pay $5/month! I believe there is an issue with the files that mmtuts has uploaded.
@alinaghale9576
@alinaghale9576 4 года назад
Sorry but I am not a member of the patreon. I was just commenting about the video tutorials.
@youssefmahersi5371
@youssefmahersi5371 5 лет назад
continue bro i really learned so much from your tutorials
@ozumbachris8297
@ozumbachris8297 3 месяца назад
Love❤ ur tutorial, just all the right things to learn as a beginner, thanks bro all your videos are nice🎉🎉🎉
@kiranpreetchadda1968
@kiranpreetchadda1968 4 года назад
Tysm mmtuts for preserving our mental health and updraging our skills via such meaningful and easily understood lectures in this pandemic. Love from 🇮🇳
@Kami-vn3ws
@Kami-vn3ws 6 лет назад
Thank you so much for this series it helped me a lot. Wish you all the best for your future videos.
@premiereduhub7429
@premiereduhub7429 2 года назад
YOU HAVE DONEVERY WELL AND I HAVE RECOMENDED YOU VIDEOS TO LOTS OF PEOPLE, I CALL YOU MY PHP TEACHER , ( I NEED A REQUEST FROM YOU, CAN YOU DO A VIDEO ON A (SIMPLE SHOPING CAT USING PHP ??? ) I WOULD BE MORE THAN HAPPY
@helloedd3265
@helloedd3265 4 года назад
You are a great teacher. I owe you.
@paulomagalhaes6752
@paulomagalhaes6752 6 лет назад
I loved this gallery of photos .. I learned a lot with this class ... But you could do an extra class here ... taught us how to zoom in and put like and commented comment data as well as the gallery .... but it was great ... a hug ... "Paulo" São Paulo Brazil ..
@selimkusursuz1788
@selimkusursuz1788 3 года назад
I want to felicitate you ! it was really useful tutorial !
@alphagaming1995
@alphagaming1995 6 лет назад
hello mmtuts you are really a good teacher on youtube.
@zakaria5775
@zakaria5775 3 года назад
I really thank you for this priceless course that I learned so much information from it, THANK YOU !
@cherierodowsky4709
@cherierodowsky4709 3 года назад
Hello! Great video. I did encounter one issue... My images were making it to the database. Data seemed to be loading on the page as I could see the title and description...I could not see the actual image. Alas, I opened web dev tool, Network tab refreshed the page, no errors. I saw the correct links for the images...ok in the network tab I selected Preview, "Hey, my images are there! but not showing on the page". Watched the video again thinking it was the while loop with the div tag...nope. Finally after watching the video for the 10th time, I noticed the style.css file in Dani's Materials location (I am a patreon) for this video is different from the one shown in the video. I changed my stylesheet to mimic the one he presents here. Boom! Everything works as expected. Yay!!!
@kLightx1815
@kLightx1815 6 лет назад
Fantastic tutorials. I have learned so much and I’ve referenced your videos more than a few times. It’s filled a lot of gaps in my knowledge. I look forward to seeing your other tutorial series
@thespacebantu7439
@thespacebantu7439 5 лет назад
Congratulation, much appreciation and respect from Dar-es-salaam. Now i can create my own restaurant P.O.S software. again thank you very much and god bless you..!
@darteysamuel9638
@darteysamuel9638 3 года назад
please were you able to upload the images to your website? if yes kindly help me at dartey85@gmail.com because mine only shows the tite and not the image. thanks
@emmanuelrobert7025
@emmanuelrobert7025 2 года назад
Dani !...THANK YOU.
@abu-hashmah
@abu-hashmah 4 года назад
I have watched your tutorials. Very helpful bro. You are the man.... :)
@wasiualhasib9970
@wasiualhasib9970 5 лет назад
Those video quality is very good. Do more.
@rechomchom804
@rechomchom804 2 года назад
Thank you so much for doing this, I was scared when it didn´t work but it was a mistake in my syntaxis xD
@expukpuk
@expukpuk 4 года назад
Nice. Thanks Mate...
@ou812927
@ou812927 5 лет назад
Thanks for a great lesson. I finally understand how to use explode and inarray. And I think I could here your dog snoring.
@loicjoseph1895
@loicjoseph1895 6 лет назад
good tutos like it a lot and I learn a lot by following ur channel
@techstudies5005
@techstudies5005 5 лет назад
An incredible tutorial am grateful for your lectures sir !!!
@nipunsachinda
@nipunsachinda 5 лет назад
need more videos .your tutorials are amazing....
@jackbergdahl9721
@jackbergdahl9721 3 года назад
Thank you so much, love your videos! keep them coming! I would like to see a like function, that moves comment or gallery picture to the top and also get visible on profile page. Take care and stay safe!
@viewvast
@viewvast 4 года назад
Do you have a tutorial on how to make a site from start to finish? Once you go through this entire course, it would be nice if there was 1 video that helped you create a basic website with a login system all details included in one single video. Great job
@ahmadwasisargar8271
@ahmadwasisargar8271 4 года назад
I followed Your site its very beneficial thank you.
@dhanasekar8495
@dhanasekar8495 4 года назад
i learned very well thanks for your lesson bro 🤩
@everythingworld6298
@everythingworld6298 4 года назад
good work do it more like this
@george6546
@george6546 4 года назад
Did you get this working? I paid for the patreon to download the files but it isn't working. If you are able to send me the files please let me know - I can provide proof that I am a member of the patreon and that I pay $5/month! I believe there is an issue with the files that mmtuts has uploaded. It still provides errors and doesn't work. If you are able to send me working files I can send you 5 dollars.
@hanznewton889
@hanznewton889 5 лет назад
You are a genius...
@technologyteach1166
@technologyteach1166 4 года назад
Hey! Daniel have a nice day 🤗!
@Shuuke-l5w
@Shuuke-l5w 4 года назад
i'm from Somalia i have never seen tutorials like this in you-tube its very good but my question is is't complete or not yet thank you so much sir for these lessons absolutely it will help some one in same day
@Shuuke-l5w
@Shuuke-l5w 4 года назад
@truth will set you free sxb bosaso jogaaa
@nonchalant8473
@nonchalant8473 6 лет назад
Great tutorials thanks!
@DankerCoder
@DankerCoder 4 года назад
PLEASE do a form tutorial, such as phpBB forms but from scratch
@CaerelsJan
@CaerelsJan 4 года назад
This series took so long but it was so gratifying to reach the end! Learned soo much, thanks Daniel! Off to your OOP PHP course now ;-)
@hudanradifan
@hudanradifan 6 лет назад
What theme you use on sublime text ?
@cleophasomwenga1833
@cleophasomwenga1833 5 лет назад
Thank you very much, have followed all your playlist from 1-65 and I have learnt a lot. Incredible tuts! I have one request, could you make the gallery of different grid sizes or rather the grid is dynamic to the size of the picture, just like the pexels.com/. Kindly
@saiaportoghese169
@saiaportoghese169 3 года назад
Instead of orderGallery could you use an "int auto_increment" ... right?
@wichiansappayabanphot186
@wichiansappayabanphot186 5 лет назад
thank you for the video
@123456az54
@123456az54 5 лет назад
hello im having a problem when i upload pic i cannot see it on my index just title and description of the image
@YouCantGetBrokeByGiving
@YouCantGetBrokeByGiving 4 года назад
i have the same problem
@riyagangwani3353
@riyagangwani3353 4 года назад
I have same problem...
@milanludvig7168
@milanludvig7168 4 года назад
same problem
@darteysamuel9638
@darteysamuel9638 3 года назад
i have the same problem
@terracobynnhaandoh6110
@terracobynnhaandoh6110 5 лет назад
Thanks a lot Daniel.. The effort you put into such videos is greatly appreciated. Is it advisable to mix up javascript and php for the same project?
@Dani_Krossing
@Dani_Krossing 5 лет назад
Yes JavaScript could definitely be used to showcase the images in full view when clicking them in the gallery.
@terracobynnhaandoh6110
@terracobynnhaandoh6110 5 лет назад
@@Dani_Krossing Okay ... thanks for the reply.
@steven9O21O
@steven9O21O 5 лет назад
UPDATE:!!! Turns out this is a permissions problem with OSX to fix this go to the folders and right click - get info and set them to Read and Write . My gallery images are now displaying properly and without issue. Keep in mind you need to do this for the parent and child subdirectories as these permissions are not inherited. Credit goes to another poster on the image upload tutorial but wanted to share this here as well. *Gazes at my now brilliantly and finally functional image gallery* Ran into an odd occurrence , while uploading to the database works great - the image does not display. BUT if I copy the extension and paste the image with the name to the directory it works. It appears as if the database is storing the files in a different location than can be accessed normally .. . Any insight ? OSX - Mojave Xampp
@wadudkhaled1636
@wadudkhaled1636 4 года назад
Thanks mmtuts.
@george6546
@george6546 4 года назад
Did you get this working? I paid for the patreon to download the files but it isn't working. If you are able to send me the files please let me know - I can provide proof that I am a member of the patreon and that I pay $5/month! I believe there is an issue with the files that mmtuts has uploaded.
@liotechtutorials7089
@liotechtutorials7089 5 лет назад
thank you so much sir for doing this for free. I really like your channel. can you do google cloud tutorials, like setting up servers and hosting the code we just did now? and also teach us to install wordpress? plzzzzzzzzzzzzzzzzzzzzzzzzzz?
@francocortez3506
@francocortez3506 3 года назад
I really wish Dani would do a pagination system. I'll have to look through his videos to see if there is one already.
@dansatch
@dansatch 4 года назад
Very nice tutorial but please is this the last episode or is there another episode???
@hanimireddy590
@hanimireddy590 6 лет назад
Brother,Can you pls make a video on chat system and thank you Sooo much for your spoon feeding tutorials :)
@isaacodeh8819
@isaacodeh8819 4 года назад
Thanks alot
@george6546
@george6546 4 года назад
Did you get this working? I paid for the patreon to download the files but it isn't working. If you are able to send me the files please let me know - I can provide proof that I am a member of the patreon and that I pay $5/month! I believe there is an issue with the files that mmtuts has uploaded.
@GinnHardcore
@GinnHardcore 5 лет назад
LIFE SAVER
@redouanebenbiga9148
@redouanebenbiga9148 6 лет назад
Great tutorial really awesome i want only ask for a pagination tutorials and progress bar php tutorials thanks
@storyden5
@storyden5 6 лет назад
I love this a lot..Thanks A lot :)
@Kuminlul
@Kuminlul 6 лет назад
u should teach ur community how to make a pagination like u click on (sry for my bad english :x)
@Kuminlul
@Kuminlul 6 лет назад
or how to make category for this gallery would like to see that how it works
@user-bg6kv5rz3z
@user-bg6kv5rz3z 6 лет назад
Thank's men good job
@birdofhermes6152
@birdofhermes6152 4 года назад
Amazing tutorial thanks a lot ))
@george6546
@george6546 4 года назад
Did you get this working? I paid for the patreon to download the files but it isn't working. If I'm allowed to ask you for help let me know
@birdofhermes6152
@birdofhermes6152 4 года назад
George I'm new to web development and only got this to work by literally following every step. Tell me what's the problem and I'll try to help.
@Stephenkiser-Stevakoboy
@Stephenkiser-Stevakoboy 6 лет назад
Great episode, thanks so much for this! I wonder if you might consider showing how to crop the images? like how facebook allows its users to?
@keanutype0896
@keanutype0896 2 года назад
in the last part, background-image. for some reason the images are not showing to me. instead, it just not appearing. no error message, just not appearing. i assume its because of css(i did not use style.css or any css) but i dont know. i could be wrong. i have the same path, coding naming as yours etc but the image is not showing in line 46 of your code. so instead, i use: echo '
@randyhopkins9895
@randyhopkins9895 3 года назад
Howdy Dani, Good day to you! hmm, not working, Upload info does go to the galleryexample database,, upload info does display on gallery page but no pic shows or in img/gallery folder. Any ideas ? Thank you again!
@DarkusChiFPS
@DarkusChiFPS 5 лет назад
Hi, to all having issues with images not showing up (or other things), I had my code and Daniels code side by side in Atom and still could not find my error! Found it using a package called Split-Diff ( I had missed the / on the end of ../img/gallery/ path, in the line $fileDestination = "../img/gallery/" . $imageFullName; ) You can install split-diff by going to Files>Settings to open a settings plane, then select install and search for split-diff. You then need to have two copies of the code, your own and Daniel's code from the Patreon download (You are supporting Daniel on Patreon right?), opened side by side, Ctrl+Alt+t to toggle diffeneces on/off. Hope this is helpful for tracking down syntax/typos and so on.
@1234zaptor
@1234zaptor 6 лет назад
Awesome. can i use this to create addToCart function?. hoping this gonna work out on my project.
@yourdailymusic6906
@yourdailymusic6906 5 лет назад
Awesome PHP series. Can anyone tell me does it end yet?
@Dani_Krossing
@Dani_Krossing 5 лет назад
I'm still uploading PHP videos :)
@yourdailymusic6906
@yourdailymusic6906 5 лет назад
@@Dani_Krossing That's great!
@haveyouseenthis6882
@haveyouseenthis6882 3 года назад
Hi Daniel, what do you suggest after this course? Should I continue to your OOP series?
@Dani_Krossing
@Dani_Krossing 3 года назад
Yes 🙂 OOP would be the next step from here. Or a framework like Laravel.
@haveyouseenthis6882
@haveyouseenthis6882 3 года назад
@@Dani_Krossing thank you. I went the extra mile in this lesson and created a delete button for each image. I created a form with the action set to a deleteimage.php file, inside that form I added a button and in the values attribute i added both the id and image name which I used in my includes file to delete the image from database and my uploads folder. Is that the right way to do it?
@aliirtaza6936
@aliirtaza6936 3 года назад
I think my question is silly. As on RU-vid, When some upload other's video on their channel, it will show you to remove the video(You know what I means). how to create that type of system in PHP????? Or which keywords should I type on google to search it???
@matejcerny4459
@matejcerny4459 5 лет назад
Hello, can I ask you how to upload multiple images? Btw great tutorial, keep going!
@alaindevtecchannel2232
@alaindevtecchannel2232 2 года назад
Thank thank you so much even though I'm a bit lost about some PHP functions you used. Which version of PHP do you use ?
@Dani_Krossing
@Dani_Krossing 2 года назад
I can't quite remember, but I know it was atleast 7.2. The functions used in the video should still be valid. :)
@alaindevtecchannel2232
@alaindevtecchannel2232 2 года назад
@@Dani_Krossing okay thank u so much
@lore2001lf
@lore2001lf 6 лет назад
Hi mmtuts. I'm writing this here because i don't know where's the best place to do it.. so I hope it's okay for you. I'd like to ask you a very simple thing: when i'll eventually upload my website, there's a risk that the password of my email (stored in the php-mail setup file) will be read from someone? If there's this danger, what can I use to send an email to someone that lost his password and wants to recover it with some randomly-generated code that i need to send to him? Thank you SO MUCH for all your videos. I followed two entire courses, leaving a like in every video of them! Sorry for my bad english, but I'll never find a safe method to check if all the words are correct or not. So.. thanks a lot another time. Have a good day/evenging!!
@SnowyAtiq
@SnowyAtiq 3 года назад
Hi Daniel! Kindly tell me, how can I create another page where I can add descriptions, large view etc & more in respect of per gallery images???
@becreative7072
@becreative7072 5 лет назад
i have images i want to show it to the right side of the website align with each other i tried a lot of things but didn't work so kindly need help , you didn't show us the css of this layout
@markwatson7475
@markwatson7475 5 месяцев назад
I had an error using this tutorial about "$stmt" being an unexpected variable, how can you fix this error?
@bheriyaswanth6998
@bheriyaswanth6998 3 года назад
stopped here! getting error Parse error: syntax error, unexpected '$stmt' (T_VARIABLE) in E:\xampp\htdocs\myfirstwebsite\gallery.php on line 60
@john8998
@john8998 6 лет назад
mmtuts more Javascript projects will be very helpful plz plz...
@DeShooter3
@DeShooter3 6 лет назад
Why are you using exit(); almost all end points. s there a very low chance to code run rest of it? Or still reads but won't execute if there is such thing like that? I have tried with exit() and without it. Still got same results. I don't understand to use of exit() Can you explain in detail?
@Dani_Krossing
@Dani_Krossing 6 лет назад
Exit() simply tells the script to stop running the rest of the script afterwards. You won't see any effect of it in the browser :)
@noelgarces6902
@noelgarces6902 5 лет назад
Some one please help me... I have completed it all and all information goes to the data base but it appears to no show the image in the PHP gallery and it does not save the image to the img/gallery folder
@lusingarib
@lusingarib 6 лет назад
When we want to have the number of rows of database can't we write Select count(*) from gallery Instead of Select * from gallery And then count the result???
@harjitsingh7308
@harjitsingh7308 6 лет назад
I have two projects you can add to your "todo list" 1) maybe make a tutorial on how to make an ecommerce site from scratch using an MVC like symfony 2) maybe making a site like spotifty or SoundCloud I think these would cool to see how they are made from scratch!
@hs-lb1493
@hs-lb1493 4 года назад
what if we have to update thr photos or delete them... its will be verry difficult to do that with this code u must use a tabel to sort the info then add a statement (this (id)) to add the update or delete option i have a way much better code and more adjustable
@mazharnazar1935
@mazharnazar1935 5 лет назад
Please create a lesson of darabase relationship concept with examples..!! Humble Request!
@aaronarela463
@aaronarela463 5 лет назад
Do you have tut about Data Table from the database that has a functionality (e.g. Search, Edit, Delete, Add, Calculate)?
@sahildhingra5374
@sahildhingra5374 6 лет назад
Hey Sir, Please create a video on Pagination and Breadcrumbs!
@Senjii1
@Senjii1 4 года назад
You have video sourcode album photo sir?
@calvinchong5179
@calvinchong5179 6 лет назад
is the filesize if-else statement correct?
@rembrandt702
@rembrandt702 6 лет назад
could not get it to work because I keep getting: localhost is currently unable to handle this request. HTTP ERROR 500
@thenidhinpr
@thenidhinpr 6 лет назад
The image is stored inside root folder and table ,but not displayed on the browser . Do anyone know why it's so , title and description is displayed on the browser
@lanzmanalo5389
@lanzmanalo5389 6 лет назад
I have the same problem, and still cant resolve it.
@thenidhinpr
@thenidhinpr 6 лет назад
i did sort the issue , image insert path might be wrong !
@lanzmanalo5389
@lanzmanalo5389 5 лет назад
What did u do?
@nachoChapaaa
@nachoChapaaa 5 лет назад
@@lanzmanalo5389 Check the size of the div
@ayomideolagoke7871
@ayomideolagoke7871 2 года назад
Hi Dani I hope you reply...please can you create an admin page using php and mysqli
@Ghjkbbkk
@Ghjkbbkk 6 лет назад
i am getting sql statement failed.I have done everything rigjt.can someone help?
@alxizr
@alxizr 6 лет назад
make sure that you are checking for the false positive and also wrote the proper method name, i mistyped the name and sat on it for about 2 hours. look at this code and compare with yours: $query = "SELECT * FROM gallery ORDER BY gallery_order DESC"; $statement = mysqli_stmt_init($connection); if ( ! mysqli_stmt_prepare( $statement, $query ) ) { echo "sql statement failed!"; }//if
@harrychinogara9625
@harrychinogara9625 6 лет назад
I am also having the same problem..
@nicholasflint9480
@nicholasflint9480 4 года назад
@@alxizr Legend, this fixed mine
@alijawwad7169
@alijawwad7169 6 лет назад
My Apache is not connecting even after changing 80 to 81 and to 8080 what should I do? Please help me.
@robertcastle4479
@robertcastle4479 3 года назад
how can i update a picture into an existing row
@memo7878
@memo7878 5 лет назад
Can we make it admin only?
@ribaljeanhaddad3630
@ribaljeanhaddad3630 4 года назад
can you make a video about how to upload photos to it corresponding album?
@rafaeltab
@rafaeltab 6 лет назад
Could you please make a tutorial on how to use an SSL certificate when connecting to a mysql database?
Далее
ДОМИК ДЛЯ БЕРЕМЕННОЙ БЕЛКИ#cat
00:45
53: Delete profile image using PHP - PHP tutorial
22:37