开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜