Jump to content

Help please :D


Adam6

Recommended Posts

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]
Link to comment
Share on other sites

[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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.