Page 1 of 1

How to GetPage - why does this cause so many errors?

Posted: Mon Mar 26, 2012 4:19 pm
by simonmlewis

Code: Select all

$page = $_GET['page'];
if ($page == "") { }
else
{
function getPage()
{
 $thispage="includes/".$_GET['page'].".inc";
 include $thispage;
}  
} 

$menu = $_GET['menu'];
if ($menu == "") {}
else
{
function getMenu()
{
$thismenu="includes/menu/".$_GET['menu'].".inc";
include $thismenu;
}
}
[text]
[26-Mar-2012 20:47:21] PHP Warning: include(includes/undefined.inc) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in /home/domain/public_html/index.php on line 110
[26-Mar-2012 21:01:09] PHP Warning: include(includes/menu/ho.inc) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in /home/domain/public_html/index.php on line 121
[/text]

The 110 and 121 are include $thispage and include $thismenu.

Why would it cause these errors like thousands of times?? And is there anything I shoudl ask our hosts; ie. is it down to apache version?

Re: How to GetPage - why does this cause so many errors?

Posted: Tue Mar 27, 2012 1:37 am
by azycraze
your variable $page is not set.
please post more code and your folder structure.

Re: How to GetPage - why does this cause so many errors?

Posted: Tue Mar 27, 2012 4:00 am
by social_experiment
simonmlewis wrote:Why would it cause these errors like thousands of times??
Are all the errors created on one execution of the script

Re: How to GetPage - why does this cause so many errors?

Posted: Tue Mar 27, 2012 4:57 am
by simonmlewis
Azxycraze was correct, just noticed myself too.