I own a shortening service of URLs
without using databases. Nor% JSON
is used to store the information, but it is stored in variables defined in a file which is rewritten by .htaccess
in the /urls
directory. Each file name is the name of the% co_of% shortened.
Example: shortener.com/urls/sitio.php can be written as shortener.com/site.
These variables that are defined in each file URL
serve for example the browser title, the password to access the PHP
(if it has been put or not in the visitor's input), etc.
I am in the development part of URL
, in which I offer a page in the site that contains a public list of all API
, having to list the number of files with glob in URLs
of the directory / urls, however I would like to know how to read each file in the directory PHP
(like a wildcard) and read the values of the variables. I'm not good with the concepts in php, but a /urls
for me is something that is in quotes, an example:
value
I need to read three variables of all the files in the directory that are $longlink = "aqui la value";
, longlink
and alias
and that I can code them with password
later.
Thanks. PS: Each file has header () to redirect to the long URL, so using include () will not be useful because it will redirect to that page.