Page 1 of 1

PHP script to include webpages with in a page

Posted: Wed Apr 15, 2009 3:25 pm
by mikemxc
Im sorry to ask im sure such a silly question. But, I can't for the life of me find the simple script to include a page with in one php page.

where you would use te url like http://anypage.com/index.php?id=signup

then the script would just include signup.php within index.php.


help please..

thanks

Re: PHP script to include webpages with in a page

Posted: Wed Apr 15, 2009 3:31 pm
by andyhoneycutt
You could accomplish something like that by using require, require_once, include, include_once -- but be sure to make sure the input from the url is solid and sanitized before issuing it into any if the above statements. I would recommend keeping a list of the pages that are acceptable to you as includes, either in a database, flat file, or array in the code itself to compare url input against.

-Andy