How to make a folder dynamically with PHP
I want to allow the user to add something, and get a folder:
example.com/foo
But I DONT want the folder to actually be there, I want it to be made instantaneously, so tha开发者_开发技巧t I can still use the directory foo for private files (If I wanted to).
The name of the folder will be stored in a mySQL database, so all that remains is to map it. But how?
Maybe this is what you're looking for. Instead of doing example.com/foo
, use example.com/something/foo
. Then use an .htaccess rewrite rule:
RewriteEngine on
RewriteRule ^/?something/(\w+)$ fake.php?file=$1
Then you could have fake.php
do everything that you need it to.
精彩评论