Varible from URL isnt working with Template.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Dale
Forum Contributor
Posts: 466
Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks

Varible from URL isnt working with Template.

Post 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;
)
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Since your getting $temppage from the url you should use $_GET['temppage'] unless you have global variables on.
Dale
Forum Contributor
Posts: 466
Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks

Post by Dale »

Nope, still dont work.
Post Reply