The user loads the logo, the file is assigned a name: userID<имя файла>.<расширение>
How then to bring the logo to the page?

 <img src="/images/<?php echo $userID;?>???.???"> 

    1 answer 1

    Use the glob function - it is able to return the list of files by mask. It is only necessary to correctly handle the situation if there are several files or nothing is found. Somewhere like this (I haven’t written to php long ago)

     $f = glob("images/$userID*"); if (count($f) == 0) { echo "<img src=\"/images/none.png\">"; } else { echo "<img src=\"/images/".$f[0].".png\">"; } 
    • Semushin Sergey, in this case it is better to write a comment to the author than to immediately change someone else's text. Your edits can be regarded as significantly changing the author's meaning. - AK
    • Well, let's do it :) 1) judging by the question, there should be a dot after $ userId and before the extension 2) glob returns the path to the file, not just its name 3) in this case it is more logical to use single quotes to avoid escaping double inside lines - Semushin Sergey
    • @ SemushinSergey Thank you. - AK