Jump to content

[SOLVED] Files and directory extensions


Flava

Recommended Posts

Hey everyone,

I'm currently running a website that generates dynamic images for users, for use in their signatures on forums. For example, I have created an image file (using PHP) and the address is http://www.website.com/tags/tag.php?u=Flava (an example).

 

However, it seems that some forums block the ?u=Flava and so doesn't display it correctly - so instead, I would prefer to link to addresses such as http://www.website.com/tags/Flava.php (so that the users username, is in fact the filename). I know this is possible as I have seen it done elsewhere, however I am not too sure how to achieve it.

 

Any help greatly appreciated!

Link to comment
https://forums.phpfreaks.com/topic/55010-solved-files-and-directory-extensions/
Share on other sites

I generate forum signatures on my site. What I do to be forum friendly is use forward slashes, and trail it with a .png.

 

IE: http://www.website.com/tags/tag.php/Flava/tag.png

 

It gives the illusion that you're sending tag.png, even though your server is actually runing tag.php. Then, you can explode the $_SERVER['REQUEST_URI'] to get the data in the url ("/Flava/") and use it as input. It works well for me.

 

You can also use mod rewrite to form a real .png address from a get query.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.