Users upload their photos on my site (for avatars), but I do not know how to give them back when the user leaves a comment. How to implement it? Somehow it is not tricky .. please, so that you can sort it out.

  • Users upload photos to the server. It means the server and should "give them away" .. How are they stored at all for users? - InDevX
  • Do you have a table with users in the site database? Generally database used on the site? - Skrillexazem
  • @Skrillexazem is, there ID, login and many other columns. (2 unique columns - login and email) - Cool_cool pm
  • @InDevX Saved to the folder on the server in the following way (see the best answer): ru.stackoverflow.com/questions/980014/… - Cool_cool pm
  • one
    Renaming is simple ... if (move_uploaded_file($_FILES['picture']['tmp_name'], $uploadfile)) { <= here $uploadfile is a new file name, how to change it, so the file will be called .. And about output .. Well, here it is very simple .. If you name the files using the user id then the base is not needed, but you just need to find the picture on the пути/к_файлу/[user_id].png .. Id find the user in the base and substitute it on the way. Profit - InDevX

0