Jump to content


Photo

Help please :D


  • Please log in to reply
2 replies to this topic

#1 Adam6

Adam6
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 01 August 2006 - 09:02 PM

Im trying to get a content page include to work.

This works.

<?

$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');
}

?>



This dont work.

<?

$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');
}

?>

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.

?page=example



#2 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 02 August 2006 - 01:31 AM

Ive heard if I dont include the URL it will be exploitable?


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.

#3 Adam6

Adam6
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 02 August 2006 - 10:40 AM

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  :-[




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users