-1

Undefined index: password in on line

: Cannot modify header information - headers already sent by (output started at /storage/ssd4/628/18415628/public_html/Kunj/admin/index.php:8) in on line

: Cannot modify header information - headers already sent by (output started at /storage/ssd4/628/18415628/public_html/Kunj/admin/index.php:8) in on line

Not Access!

This error comes from this code

<?php
session_start();
require_once('functions.php');
require_once('dbconnection.php');
require_once('includes/init.php');
$password = $_SESSION['password'];
$admin_data = get_admin($conn, $password);
if ($password != $admin_data['password']) {
    header('location: login.php');

1 Answers1

0

Change this line

$password = $_SESSION['password']; 

to

if(isset($_SESSION['password'])){
  $password = $_SESSION['password'];
}else{
  $password = '';
}
ADyson
  • 57,178
  • 14
  • 51
  • 63
Ishaque Javed
  • 406
  • 4
  • 14