I am developing a web application that can be customized based on which retail location the end user comes from. For example, if a user comes from a store called Farmer Market, they can be configured with content or sitelinks specific to that particular store. file_exists () is used to determine if there are any custom parts of the page that need to be imported.
So far, we have used a relatively unsafe method, in which the element identifier and storage are simply passed as GET parameters, and the system knows how to apply them to each of the links on the page. Nevertheless, we move on to a reversible hash method, in which the store number and numbers are stored (to look something like this: "gd651hd8h41dg0h81"), and the pages simply decode them and assign storage and identifier variables.
Since then, however, we have encountered a mistake that Google did not find an answer for me. There are several similar blocks of code, but they all look something like this:
$buttons_first = "../stores/" . $store . "/buttons_first.php"; if(file_exists($buttons_first)) { include($buttons_first); }
(the / stores / directory is located above the working directory, therefore ... /)
Pretty simple. But, despite the fact that it works fine when using a regular identifier and storage, using an encrypted identifier causes this error for each of these similar operators:
Warning: file_exists () expects parameter 1 to be a valid path, the line specified in [url deleted] on line 11
I had a typesetting script of the full url and it seems to be assigning $ store correctly. I am running PHP 5.4.11 on 1 and 1 hosting (because I know that they have some deviations in the operation of their servers), if that helps anyone.
source share