Variables without files (IE: www.something.com/33432)

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!

Moderator: General Moderators

Post Reply
s3rg1o
Forum Commoner
Posts: 32
Joined: Sun Feb 16, 2003 4:58 pm

Variables without files (IE: www.something.com/33432)

Post by s3rg1o »

Hey guys, I see some sites out there with links such as

http://www.something.com/34234 where 34234 is the variable but they specify no file or variable name. I know how php.net does their function search with http://www.php.net/substr but that just redirects the page, I want the page to actually load from that variable, anybody know?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

if you do not redirect but include the file you might handle it like php.net does (via ErrorDocument)
s3rg1o
Forum Commoner
Posts: 32
Joined: Sun Feb 16, 2003 4:58 pm

Post by s3rg1o »

got it, thanks
s3rg1o
Forum Commoner
Posts: 32
Joined: Sun Feb 16, 2003 4:58 pm

Post by s3rg1o »

Ohhh yeh

I did get it to work with ErrorDocuments

so everything goes to /index.php

that's fine, but I don't want all the errors to do that

for instance, http://www.something.com/images/11112/

I want 11112 to be the varaible, in the directory images, but I want that error to go to /images/index.php rather than /index.php

I attempted using .htaccess 's in both directories, but no luck

any ideas?
Post Reply