Answer the question
In order to leave comments, you need to log in
Where could 1 come from here?
Index
include_once('core/properties.php');//Подключение к базе
session_start();//Начало сессии
$header = include_once('tmp/header.php');//Head
echo $header;
$news = include_once('tmp/news.php');//News
echo $news;
$footer = file_get_contents('tmp/footer.php');//Footer
echo $footer;
<?
if (empty($_SESSION['login']) or empty($_SESSION['id'])){
echo '
<form class="head_cont" method="post" action="/core/modules/logon.php">
<input type="login" name="login" placeholder="'.$lang['login_title'].'" />
<input type="password" name="password" placeholder="'.$lang['login_pass'].'" />
<input type="submit" value="'.$lang['login_button'].'" /><br />
<a href="/join.php">'.$lang['join_title'].'</a>
</form>
';
}
else{
$id=$_SESSION['id'];
$login=$_SESSION['login'];
$name=$_SESSION['name'];
echo '
<div class="head_cont">
Добро пожаловать, <a href="/ip192.168.10.'.$id.'">'.$name.'</a>!
<br /><a href="/logout.php">Выйти</a>
</div>';
}
echo '<html><head><title>'.$lang['site_name'].'</title><link rel="stylesheet" href="tmp/css/style.css" /></head><body>';
echo '<div class="header"><p><a href="/">'.$lang['site_name'].'</a></p></div>';
?>
Answer the question
In order to leave comments, you need to log in
include_once returns TRUE , which when echo is implicitly cast to a string, that is, to 1: php.net/manual/en/language.types.string.php#langua...
Solution: remove echo next to include and go read the documentation.
ob_start();
include_once('tmp/header.php');//Head
$header = ob_get_clean();
echo $header;
ob_start();
include_once('tmp/news.php');//News
$news = ob_get_clean();
echo $news;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question