[thelist] php questions

Kasimir K evolt at kasimir-k.fi
Thu Jun 23 09:54:26 CDT 2005


> Nan Harbison wrote:
>>First of all, there are a few files that have no extension on them, no .php
>>or anything, and somehow they turm into a folder, for example, the events
>>file turns into events/add when you are adding an event. I can't figure out
>>how this was done. Can someone please point me in the right direction?
>> 
>>
misterhaan scribeva in 2005-06-23 12:51:
> that's really all that needs to be done.  file named events gets used, 
> and /add is available either through the querystring or just from the 
> request uri.  i've heard of this being done by people who either don't 
> want to or don't know how to use apache's mod_rewrite.

I sometimes use in my .htacccess file the following:
<Files *>
SetHandler application/x-httpd-php
</Files>

This is usefull if I don't have access to the httpd.conf, as mod_rewrite 
is very slow if done in .htaccess files. If you have other than PHP 
files in the directory, then you should take care that they get correct 
headers etc.

To get the querystring from URIs shaped like this is use:
$uriElements = explode('/',
    str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['REQUEST_URI']));

.k


More information about the thelist mailing list