Does anyone know how to make something that assigns a variable in PHP to an actual file.
(i.e - <?php $filename = root directory\subdirectory\$filename || root directory\sub directory2\$filename ?> )
basically i'm trying to make something that takes the entry value from a form and displays all the pictures related to that query (eg search for "car" finds images "car.jpg, carpet.jpg, mycar.jpg, mycarpet.jpg, etc etc" (sub question, can you use asterisks in filenames to remove the need for exact filename query? if so what is the syntax? - would this be right or no,
<?php if ($filename == "*$filesubject*.jpg") { etc..
and how could you go about getting the automatic .jpg file extension added, i presume something like $filesubject = $filesubject.jpg
Once I have done this, how do you make a loop of all the search results, because they're files.. you can't just $filename++ i presume so how is it done?
Any help would be most appreciated. I only thought of the idea this morning so i've only been going on it an hour or so, but thought best to get the idea in now.
P.S. I'm aware I COULD do something like giving each photo an ID number and then doing a huge database style cross-reference/search, but looking for an easier way that hopefully doesnt include MySQL.
(i.e - <?php $filename = root directory\subdirectory\$filename || root directory\sub directory2\$filename ?> )
basically i'm trying to make something that takes the entry value from a form and displays all the pictures related to that query (eg search for "car" finds images "car.jpg, carpet.jpg, mycar.jpg, mycarpet.jpg, etc etc" (sub question, can you use asterisks in filenames to remove the need for exact filename query? if so what is the syntax? - would this be right or no,
<?php if ($filename == "*$filesubject*.jpg") { etc..
and how could you go about getting the automatic .jpg file extension added, i presume something like $filesubject = $filesubject.jpg
Once I have done this, how do you make a loop of all the search results, because they're files.. you can't just $filename++ i presume so how is it done?
Any help would be most appreciated. I only thought of the idea this morning so i've only been going on it an hour or so, but thought best to get the idea in now.
P.S. I'm aware I COULD do something like giving each photo an ID number and then doing a huge database style cross-reference/search, but looking for an easier way that hopefully doesnt include MySQL.