Page 1 of 1

Dynamic including problem

Posted: Mon Feb 16, 2009 12:22 am
by Aleks
Hello Guys! Ive been looking for an idea about "how to create a dynamic including (by folder?) on php" but i just cant find the answers. I tried searching using the different search engines but still i cant get what i find.

here is what i mean about dynamic including?

index.php?pagename=folder&page=pagename


Hoping for your help,

Aleks

P.S. I am actually new on php.

Re: Dynamic including problem

Posted: Mon Feb 16, 2009 12:27 am
by s.dot

Code: Select all

require $_GET['pagename'] . DIRECTORY_SEPARATOR . $_GET['page'];
But definitely check if it exists first, check if it's allowed, and cleanse the input.

Re: Dynamic including problem

Posted: Mon Feb 16, 2009 1:01 am
by Aleks
<a href="index.php?pagename=folder&page=pagename">Link Name</a> this actually the link look like.