MyBB Community Forums

Full Version: New Page error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Ok, I was trying to make a new custom page for my forum, just like I did all my others. As a matter a fact I copied the php file and just changed it around.

Anyway, this is the error I'm getting when I try to access the new page I've just made. I've done the template and all and I still can't access it!

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /usr/local/djcsites/dajoob.com/firefox/thanks.php on line 2

Parse error: syntax error, unexpected T_STRING in /usr/local/djcsites/dajoob.com/firefox/thanks.php on line 2

And here's my thanks.php PHP file!

<?php

require "./global.php";

addnav("Thanks", "thanks.php");

eval("\$thanks = \"".$templates->get("thanks")."\";");
outputpage($thanks);
?>

Is there something wrong there?

FW
The PHP code snippet you posted has no syntax errors. Are you sure it's the exact same code that's in the thanks.php file on your server? [Image: xso_undecided.gif]

Maybe the error is in the template, although I'd expect the error message to say "eval()'d code on line x" in that case...
I think there's a double quote in the thanks template. The solution is to escape the template:
eval("\$thanks = \"".addslashes($templates->get("thanks"))."\";");
But in all my other pages (mycode.php & rules.php) I used this same php code!
I wonder what went wrong this time! Sad
Can you post the template code please.
Here's all the template I've created atm,

<html>
<head>
<title>$settings[bbname]</title>
$headerinclude
</head>
<body>
$header
<br />
<table width="100%"  border="0">
<thead>
<tr>
<th>Thank You!</th>
</tr>
<tbody>
  <tr>
    <td>Special thanks to..

   <center><b>_ISR_m3rc_</b><br>
   For helping create this forum.</td>
  </tr>
</tbody>
</table>
$footer
</body>
</html>

FW
That's strange.. I get no errors what so ever when trying it.
Hmmm...it doesn't work on my server:

http://www.drpoodle.com/forums/thanks.php
Hmmm, maybe I got a better server :p

See this is all I used in thanks.php:
<?php
require "./global.php";
addnav("Thanks", "thanks.php");
eval("\$thanks = \"".$templates->get("thanks")."\";");
outputpage($thanks);
?>
and this for teh template thanks:
<html>
<head>
<title>$settings[bbname]</title>
$headerinclude
</head>
<body>
$header
<br />
<table width="100%" border="0">
<thead>
<tr>
<th>Thank You!</th>
</tr>
<tbody>
<tr>
<td>Special thanks to..

<center><b>_ISR_m3rc_</b><br>
For helping create this forum.</td>
</tr>
</tbody>
</table>
$footer
</body>
</html>
I have no idea why it's working on mine and not on yours?
Maybe you it's a conflict with PHP Versions?
Pages: 1 2