PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I've seen a number of sites that have their links like this: http://www.site.com/?p=page .. normally I was intrigued & would now like to know how to do it too
I've always been doing links like somepage.php?var=value ..
If I try opening for example http://localhost/?p=some_test (for testing purposes obviously..) the browser outputs that anoying 403 error page.
Can anyone tell me how that shortening or masking or whatever is done?
If you haven't configured index.php to be one of your directory indexes than it wont.
Go on.. keep explaining
You see.. I've been kidding around with php for a little more than a month's time.. so I don't know that much.
Or maybe I'm just confused.. what do u mean by configuring index.php as a directory index?
I'd appreciate some help here.. maybe even an example code if anyone could be bothered..?
That should make it so that your index.php file will be called when the directory is accessed... hence allowing you to go... http://www.site.com/?action=whatever
If your using apache than the directory index is a directive inside the config file httpd.conf. Directives are basically what settings are called if you use apache. The directory index directive is a setting that tells apache which file(s) should be used by default.
When you use a url like http://www.domain.com/?p=page then you are trying to pass the variable p with the value "page" to the directory index, or the default page which could be blah.php or foo.php. Whereas if you use a url like http://www.domain.com/index.php?p=page than you are explicitly telling the webserver to open the page index.php and pass it the variable p with the value "page"
that did the trick
thx a lot LiquidPro for the code & nigma - thx for explaining the whole thing
gee I never expected so many replies in such a short time