New Page
#1
Hi, im trying to create a new page that is generated from a template.

Im a noob to php. but after studying the other files here I have borrowed the following code.
<?php
require "./global.php";
global $settings, $theme, $templates;
$templatelist = "new_page"
/eval("\$new_page = \"".$templates->get("new_page")."\";");
outputpage($new_page);
?>
The code almost works and generates a page from my template with all the mybb headers and footer loading up.

however there is a problem with this line
/eval("\$new_page = \"".$templates->get("new_page")."\";");
causing this error message to be displayed at the top of the page
Quote:Warning: Division by zero in .....forum/new_page.php on line 5

Can anyone help me by correcting this line or by provideing me with a better script.

Thanks in advance.
#2
I see a number of problems there. Try this code instead...

<?php
$templatelist = "new_page";
require "./global.php";
eval("\$new_page = \"".$templates->get("new_page")."\";");
outputpage($new_page);
?>
#3
Thanks that worked great.

I did misspost the code i was trying to use, but all works now as intended.
#4
Thanks Rimmer for asking the question and thanks WDZ for answering it
I have another question, how do I add the age name onto the forum navigation


Forum Jump:


Users browsing this thread: 1 Guest(s)