-2

I having this error Notice: Undefined index: uid_fb

please help

<?php 
include "common.php";
if($_SESSION['uid_fb']!='' && $_SESSION['login_fb']=='true')
{
// header("Location:home.php"); 
}
Jonathon Reinhart
  • 132,704
  • 33
  • 254
  • 328
nobleman
  • 1
  • 1

2 Answers2

0
<?php 
   include "common.php";
   if (!empty($_SESSION['uid_fb']) &&
        isset($_SESSION['login_fb']) &&
        $_SESSION['login_fb']=='true')
   {
      // ...
   }

Use isset to determine if a variable has a value. Use empty to determine if a variable is not set, or empty.

Jonathon Reinhart
  • 132,704
  • 33
  • 254
  • 328
0

Add isset:

<?php 
include "common.php";
if(isset($_SESSION['uid_fb']) && $_SESSION['uid_fb']!='' && $_SESSION['login_fb']=='true')
{
// header("Location:home.php"); 
}
Christian
  • 1,663
  • 19
  • 33