Page 1 of 1

Varible from URL isnt working with Template.

Posted: Tue Jun 22, 2004 10:53 am
by Dale
Im running MyBB RC2 (Forum) and im trying to have the page index.php as my central page.

So when i type in:
http://www.tcwonline.org/~dale/index.php?temppage=index
It doesnt show the template (mainsite_index).

Heres the code of index.php:

Code: Select all

<?php
// Forums Directory
chdir('./forums');

// Get back-end (Don't Touch)
require('./global.php');

// Templates List
$templateslist = "mainsite_header, mainsite_menu, mainsite_".$temppage.", mainsite_footer";


// Start PHP Code Block
// ---------------------------------------|

// ---------------------------------------|
// End PHP Code Block

eval("\$mainsite_header = "".$templates->get("mainsite_header")."";");

eval("\$mainsite_menu = "".$templates->get("mainsite_menu")."";");

eval("\$mainsite_".$temppage." = "".$templates->get("mainsite_".$temppage."")."";");

eval("\$mainsite_footer = "".$templates->get("mainsite_footer")."";");

// Output body template
outputpage("$mainsite_header");

outputpage("$mainsite_menu");

outputpage("$mainsite_".$temppage."");

outputpage("$mainsite_footer");
?>
Please help me find the problem. (OH and the contents of mainsite_index is:

Code: Select all

&lt;font face="verdana" size="1"&gt;&lt;b&gt;The D-Frame portal is coming soon. Please feel free to post in the &lt;a href="./forums/" target="_blank"&gt;forums&lt;/a&gt;.&lt;/b&gt;&lt;/font&gt;
)

Posted: Tue Jun 22, 2004 10:54 am
by kettle_drum
Since your getting $temppage from the url you should use $_GET['temppage'] unless you have global variables on.

Posted: Tue Jun 29, 2004 6:29 am
by Dale
Nope, still dont work.