I have a name in a database, lets say its ‘DFectuoso’ and some legacy system stored DFectuoso_randomnameofafile.doc.
Now I want to find all the filed ‘DFectuoso’ owns and display links to them in a PHP page.
What would be the way to start on this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’d try with
glob()in combination withreadfile().Off the top of my head:
and just pass the file with
readfile().Remember, if you are using
$_GETto pass the chosen file to the user, sanitize and validate the permissions first. Don’t do justreadfile($_GET['chosenFile']);or you’ll get in trouble!