Notice: Undefined index: username in D:\programing\xampp\htdocs\brackets\admin\config\setup.php
when logout the value of $_SESSION become Undefined in setup file where the function of $data_user is and that is obvious cuz i just unset it be logging out but the error is there hope i find help here...
Ok, just post your code here (setup.php is the only one necessary) and I'll find the error and give you a solution :P If the code looks messy use http://pastebin.com/
`<?php
#database connection include('../config/connection.php');
#functions include('functions/data.php'); include('functions/template.php');
#constants DEFINE('D_TEMPLATE', 'template');
#site setup $debug = data_settengs_value($dbCon, 'debug-status');
#default id for the url if(isset($_GET['page'])) { $pageid = $_GET['page']; } else { $pageid = 1; }
#page setup $page = data_page($dbCon, $pageid);
#user info setup $user = data_user($dbCon, $_SESSION['username']); ?>`
this is my code, thank you for your help :)
Well it's actually very simple.
Just place this on the part where you call the user function (#user info setup):
if(isset($_SESSION['username'])&&!empty($_SESSION['username'])){
$user = data_user($dbCon, $_SESSION['username']);
}
I can't check the code because I'm on my phone, but it should work (and be correctly written). You should add something similar to the outputs too.
That basically checks if the username exists, and that is valid 😉
thank you very much :), actually it's my first course of coding, i have just started learning php from youtube.. @creptor