52: How to upload profile images to users using PHP - PHP tutorial

preview_player
Показать описание
How to upload profile images to users using PHP - Learn PHP backend programming. In this episode we will learn how to upload profile images to users in a website.

➤ 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 :)

Рекомендации по теме
Комментарии
Автор

KEEP GOING MY MAN... You are very good teacher.... thank you....God bless you!

cncrobopro
Автор

Please do a video on how to send emails to confirm email accounts and forgot password recovery. Awesome teacher!! Stay blessed.

iammrkc
Автор

Daniel, your voice hasn't changes for the 3 years I've been learning from your tutorials; you're like the most positive guy ever! Keep being you, I love it.

riskitall
Автор

I really love your tutorials, they are so easy to learn and your voice is so calming and smooth, haha, thank you for these. <3

HannesF
Автор

So awesome! I know its such a pain to record all these videos with Quality Content in it! Thanks for it! You're a Pro!

shiva_tharun
Автор

IF I was to praise you for your tutorials it won't stop but thank a millions times

cleverengineer
Автор

Your tutorials are amazing. They are so well explained and you have covered every bit of the language. FYI, I followed your tutorials and I got an internship. So thank you for making all these wonderful, full of php knowledge videos.

muneezanasir
Автор

Finally! your tutorial helps me a lot for my school project

patrickrenzgarcia
Автор

Awesome video. Thanks for doing my assignment. Gives me time to go for a bike ride today!

daverdal
Автор

Dani you are great, you are better than stack overflow

YPTechDATIA
Автор

I was able to do your login/signup system with just a few mistakes and then I rushed through your command lines on this one and had all kinds of errors lol. I was a little frustrated at first and stomped, but I eventually caught all my mistakes. I actually learn more by messing up the code then doing it right, haha. It forces me to learn to read the code and learn how the errors correlate with my syntax mistakes. It also forces me to experiment to validate how far the code is actually processing correctly.

Thanks Daniel, your tutorials are very informative with your explanations. Keep them coming. :)

ulosturedge
Автор

@42:54 I am stuck in this part. I don't see default pic and the username.. But I did follow everything.. Help..

suraamilbahar
Автор

Tnx a lot to the efforts sir ... Now only had left about statuses not alone in their data

mackynikat
Автор

Your channel have saved me many times now! Thank you!

sandy
Автор

u r such a great teacher i ever seen
respect from pakistan

adnanshoukat
Автор

Thanks for all these tuts, they are really helpful, this one was a handful tough!!! I just finally got it.

XJerome
Автор

Thanks so much Dani, you are an amazing teacher.
Interestingly concepts from your teachings have been so helpful in preferring solutions to some of my projects, sometimes unrelated to the tutorial.
Keep up the good work sir!

olukoyaabbey
Автор

You are amazing you solved my 2 nights of sleeplessness i will check other things you offer and if there are some sort of courses then i have to buy from you!

maajabusafaris
Автор

So nice of you for teaching us all these about php. Please guide how can i launch mob camera in feed back form.. Like there will be a feedback form with submit option and capture image option.. The capture image option should turns on the mobile camera and take the picture, save it in sql data base and send along with the form when clicked on submit button.

RubaAab
Автор

WOW Man was this one ever the bees knees.. I had a 3 day time (I'm legit a beginner just started coding php last week thanks to you) figuring out how not only to mash this into the previous episode but also your large 2 hour login system video which idk on your upload schedule but it seems like it was a reupload and came years after this lol.. good fight though I STILL dont have the idea 100% at this time but I'm PRETTY sure I know where to go from here and this video has helped me as far as it can so thank you so much Daniel you are awesome brother.


If anyone's having problems with this still let me see if I can point you in the right direction with issues I faced: FIRST let me disclose i tossed away his second table profileimg all together and used the previous login database which in that other video he called "users" which already had 4 categories idUsers uidUsers then email and pass but those two are the important ones.


so first I added a column to my table called status just like his: int (11) not null etc


issues I faced were not paying attention to when I was supposed to be SELECTING from the number column or the name column.. you have to follow this video exactly and anywhere he writes ANYTHING with an id first its always referenceing the number one in my case was idUsers.


likewise anything he writes with a username for me was uidUsers


Dont be a hero and write your own attachments or improvements if your a beginner like me .. you dont know the jack you think you do lmao big tip here wasted a lot of hours like "man i know whats going on here so what if i..." yeah dont lol


I ran into an issue where i accidently called my default profile image "profiledefault.jpg" lmao it kept showing up as a blank square instead of the image and glancing over the comments i might have been the only dummy on this one lol. I was essentially looking for something called "profiledefault.jpg.jpg" unintentionally.


Lastly I have completely different login and signup systems .. if you have one like me you can circumvent that entire signup segment in here by just simply adding a parameter to your signup.php or whatever you call it in the INSERT INTO section youd already have and add a VALUE to it of 1 in my case hed used several questionmarks mine looks like this now:
INSERT INTO users (uidUsers, emailUsers, pwdUsers, status) VALUES (?, ?, ?, 1)
thus rendering all this:


$sql= "SELECT * FROM users WHERE uidUsers='$username'";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0){
while ($row =
$username = $row['uidUsers'];
$sql = "INSERT_INTO users (status)
VALUES (1)";
mysqli_query($conn, $sql);
}
}
Useless... (note the types of changes i had to make from his original code and you could easily do this also)


but make sure you look in your login system and be mindful that your _SESSION ids are set correctly i was trying to use stuff like idUsers and my uidUsers in places i should have had my actual _SESSION id's .. Which as a quick example are $_SESSION['userId'] = $row['idUsers']; so i had to go back and find anywhere he referenced his first table which i diddnt have as either just "id" or "username" or anything like that and make sure i had the right ones.. using one table it actually streamlines the process cutting out a lot of EXTRA stuff.


Hopefully this helps anyone lol I wish someone would answer some of the questions in these comments much more when they figure them out haha .. oh well help where I can much love all =)

lebronzejames
join shbcf.ru