MultiOgar icon indicating copy to clipboard operation
MultiOgar copied to clipboard

How to make skins users

Open Tyskacz opened this issue 8 years ago • 18 comments

I made a simple login script. I would now like to allow the user to upload his skin and the uploaded image will be to MySQL. The next time you log in will automatically be set skin

Tyskacz avatar Jan 10 '17 08:01 Tyskacz

refresh

Tyskacz avatar Jan 11 '17 22:01 Tyskacz

give the script? pls

Shair17 avatar Jan 12 '17 04:01 Shair17

if you can

Tyskacz avatar Jan 14 '17 06:01 Tyskacz

crazy english)

F0RIS avatar Jan 16 '17 20:01 F0RIS

@Tyskacz You can't upload images to mysql, however you can base64 encode those images and store them in a large data type.

@Jhair2015 trust me, you probably don't even want it...

segg21 avatar Jan 18 '17 22:01 segg21

@LegitSoulja "You can't upload images to mysql" what about data type called "BLOB" ?) But this approach is not good, much better just store images in directory and write to mysql path for that file

F0RIS avatar Jan 18 '17 22:01 F0RIS

@F0RIS ~~why even store data of image links? glob("skin/directory/*.png") returns an array of those images. You could then use ajax, to request that file in which will then list all the skins that exists in the directory.~~

Yes, write the path of that "image" after uploaded, or selected to the user skin him/her or it self..

segg21 avatar Jan 18 '17 22:01 segg21

And mybad for saying that you can't store images, you can get the content of the image but why? Why store images in mysql? Kindof pointless in my opinion.

segg21 avatar Jan 18 '17 22:01 segg21

@LegitSoulja we don't know what exactly want @Tyskacz implement. But I can agree with you, may be he don't need database at all)

F0RIS avatar Jan 18 '17 22:01 F0RIS

@F0RIS people never think of efficient ways to do things. That however is not an efficient way of doing so.

segg21 avatar Jan 18 '17 22:01 segg21

@LegitSoulja thinking of efficient come with experience)

F0RIS avatar Jan 19 '17 13:01 F0RIS

"Efficiency" - Yet, why not go look for another way?. Why use php and or MySQL when you barely don't know how to use it.

segg21 avatar Jan 19 '17 19:01 segg21

@LegitSoulja If I will try to answer it's gonna be a long conversation))

F0RIS avatar Jan 20 '17 17:01 F0RIS

@F0RIS The answer is. Go and learn about something before doing so. Anyways, I'm done with this conversation. Have a nice day.

segg21 avatar Jan 20 '17 20:01 segg21

Okay, keep the link to the skin in MySQL but I want the script to someone who logs on is immediately loaded skin.

I use TranslateGoogle, my language is Polish

Tyskacz avatar Jan 21 '17 12:01 Tyskacz

@Tyskacz Ok. Set it when they log in, the same way you'll save their username, and make sure you encrypt the user password. Using hash.

Adios.

segg21 avatar Jan 21 '17 17:01 segg21

FYI, hashing is not encrypting since "encrypt" implies it can be decrypted whereas hashes cannot be converted to the original text. Please don't encrypt the password; hash it.

chuushi avatar Jan 31 '17 17:01 chuushi

@SimonOrJ You, Him. Gets the idea.

Thanks.

segg21 avatar Aug 17 '17 19:08 segg21