Jump to content

Require acting bizarre


PHPiSean

Recommended Posts

This error is very bizarre since I can't seem to debug it. When I require my header, it is included. When I require my footer, it is not. I am 100% the paths are correct, and I tried another file to make sure it wasn't the footer causing the error. Here's the code for the header, footer, and index. If you need to see anything else just tell me.

 

header

<?php ob_start(); ?>
<?php ini_set('session.cookie_domain', '.domain'); ?>
<?php ini_set('display_errors','On'); ?>
<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
    <link rel='stylesheet' href='includes/css/reset.css' type="textcss"/>
    <link rel="stylesheet" href="includes/css/style.css" type="text/css"/>

    <title>Domain</title>
</head>

<?php
require('classes/common.inc.php');

$common = new common();

if($common->_truesession()) {
    $hsuser = $_SESSION['username'];
}

$common->_cookiecheck();

$db = $common->_db();

echo "<ul>";
echo "<li><a href=domain.com>Domain</a><ul>";

$query = $db->_query("select * from links where id > 1");

while($row = $db->_assoc($query)) {
    $name = $row['name'];
    $link = $row['url'];
    echo "<li><a href=".$db->_out($link).">".$db->_out($name)."</a></li>";
}

echo "</ul></li></ul>";
?>

 

index

<?php require('includes/header.php'); ?>
<?php

?>
<?php require('includes/footer.php'); ?>

 

footer

<?php

echo "<ul>";
echo "<li><a href=about.php>About</a></li>";

if(!$common->_truesession()) {
    echo "<li><a href=register.php>Register</a></li>";
}

echo "</ul>";

$year = date('Y');
echo "&copy $year <a href='http://domain.com'>Domain</a>";


ob_end_flush();
?>

Link to comment
https://forums.phpfreaks.com/topic/250586-require-acting-bizarre/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.