: Undefined index: log in C:xampphtdocstutorialshome.php on line 20 18 <?php 19 include("session/DBConnection.php"); 20 $user = $_SESSION['log']['username']; 21 $query = mysql_query("SELECT * FROM members
18 <?php
19 include("session/DBConnection.php");
20 $user = $_SESSION['log']['username'];
21 $query = mysql_query("SELECT * FROM members WHERE username = '$user'");
22 $display = mysql_fetch_array($query); ?>
23 <title>sagar- <?php echo $display['firstname'] . " " . $display['lastname'] ?> 23</title>
please help me out...i am so confused...show me ans in code ....what should i have to write....please guys help me..!!
More posts by @Lee4591628
1 Comments
Sorted by latest first Latest Oldest Best
You need to check if that array key has been set before using it.
$user = isset($_SESSION['log']) and isset($_SESSION['log']['username'])
? $_SESSION['log']['username']
: '';
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.