Adam6 Posted August 1, 2006 Share Posted August 1, 2006 Im trying to get a content page include to work.This works.[quote]<?$page = $_GET['page'];define ("homeurl", "");if ($page=='') {include('content/index.php');} elseif (!file_exists('content/'.$page.'.php')) {include('content/index.php');} else {include(homeurl.'content/'.$page.'.php');}?>[/quote]This dont work.[quote]<?$page = $_GET['page'];define ("homeurl", "http://www.pspbrew.net/opasit/");if ($page=='') {include('content/index.php');} elseif (!file_exists('content/'.$page.'.php')) {include('content/index.php');} else {include(homeurl.'content/'.$page.'.php');}?>[/quote]Why dont the second one work ffs. I want to include the URL. Ive heard if I dont include the URL it will be exploitable?Help me please. Im a noob :'(Im using this to goto the page/include.[quote]?page=example[/quote] Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted August 2, 2006 Share Posted August 2, 2006 [quote]Ive heard if I dont include the URL it will be exploitable?[/quote]No more than using this method to display page content ever is. Just make sure you do some sort of check to make sure that the only input it will accept is what you want it to be.Remove the http://www.pspbrew.net from the define statement and it should work. Quote Link to comment Share on other sites More sharing options...
Adam6 Posted August 2, 2006 Author Share Posted August 2, 2006 Thanks for your reply mate.Can you edit the code to include the check for me please. As I said im a PHP noob and my PHP skills are very limited atm :-[ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.