Answer the question
In order to leave comments, you need to log in
Error in session_start...?
There are pages on the site that require authorization to view, otherwise they are redirected to the main page, and so, everything works, but the error_log constantly gives an error. The error is on the first line. It seems that I re-read the session manual, apparently I missed something, I want to somehow eliminate this error.
<?php
session_start();
$vlogin = $_SESSION['login'];
$n = "";
if($vlogin == $n){
header('Location: /');
}
else{
}
?>
Answer the question
In order to leave comments, you need to log in
session_start();
Must be before any content is displayed on the page. If you have include, then you do not need to write session_start () again in other files;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question