PDA

View Full Version : Problem with if ($_REQUEST['do'] == 'xxx'')


Triky
06-26-2009, 02:22 PM
I have a .php file with that code. My problem: if I go to file.php?do=xxx.. I see the same that's on file.php. This is the code I'm using on that file:

if ($_REQUEST['do'] == 'xxx')
{
eval('print_output("' . fetch_template('mytemplate') . '");');
}

What's wrong?

Paul M
06-26-2009, 03:44 PM
I dont understand what you mean, what exactly do you get ?

IdanB
06-26-2009, 03:50 PM
try $_GET['do'] instead

Triky
06-26-2009, 04:39 PM
No, to reply to both: I get the same page I have on file.php.
Both with REQUEST and with GET.
PS: I have used this to create my page: https://vborg.vbsupport.ru/showthread.php?t=62164.

EnIgMa1234
06-26-2009, 04:43 PM
You probably have another print_output at the end of the page right?

Triky
06-26-2009, 04:47 PM
Yes, I have this code:

$navbits = array();
$navbits[$parent] = 'My page title';

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('mytemplate') . '");');

if ($_GET['do'] == 'faq')
{
eval('print_output("' . fetch_template('mytemplate_faq') . '");');
}

--------------- Added 1246040365 at 1246040365 ---------------

Solved:

if ($_GET['do'] == 'mypage')
{
eval('print_output("' . fetch_template('page_test_1') . '");');
}
else{
eval('print_output("' . fetch_template('page_test') . '");');
}