Help - Search - Members - Calendar
Full Version: Php Code Breaking :(
Zymic Webmaster Forums > Web Design & Development > Server Side Scripting > PHP
Altriak
Hi! I seem to be having a problem with the code below. When running on my local machine, the code works fine. But, when I run it on zymic, the embedded php seems to break on this line:
CODE
echo '<a href="post.php?forum_id=' . $forum_id . '" class="navlink"> New Thread </a><br />';


When I view the source, the pink php indicator stopped at "New Thread </a><br /> ..." sad.gif Any ideas?

CODE
...
...
<tr>
        <td valign="top" nowrap="nowrap" width="10%"><b>
            <a href="index.php" class="navlink">Home</a><br />
            <a href="forum.php" class="navlink">Forums</a><br />
            <?php  
if (isset($_SESSION['user_id'])) {
    if (stripos($_SERVER['PHP_SELF'], 'forum.php')) {
        echo '<a href="post.php?forum_id=' . $forum_id . '" class="navlink"> New Thread </a><br />';
    }
    echo '<a href="logout.php" class="navlink"> Logout </a><br />';
} else {
    echo '<a href="register.php" class="navlink"> Register </a><br />';
    echo '<a href="login.php" class="navlink"> Login </a><br />';
}
...
...


Linkie to page here: http://altriak.zxq.net/includes/header.html
Alex
The problem is the extension, you've named it .html, it should be .php.
Altriak
Thanks for the response! But, that really shouldnt matter...however to curb any suspicions I've renamed it to a php file smile.gif

The problem I found was that mysqli statements don't seem to be supported sad.gif

Thanks again smile.gif
Alex
Yes, mysqli is not supported, but the fact remains that <?php should NOT appear in the source you view, it should be handled by mod_php before it gets there. And the reason it wasn't was because you had .html files rather than .php (.html files are not run through the PHP parser).
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.