Im trying to make a way to display one text if logged in and another if not logged in. i am having problems is with when im calling for the session. i have no experience with php and have gotten alittle help from many people.
HTML:
[code]<?php if(empty($login_session)){?>
Register
Login
This is the code im working with to call for the $login_session:
[php]<?php
include(‘config.php’);
session_start();
$user_check=$_SESSION[‘login_user’];
$ses_sql=mysqli_query($obj->conn,"SELECT username FROM users WHERE username=’$user_check’ ");
$row=mysqli_fetch_array($ses_sql,MYSQLI_ASSOC);
$login_session=$row[‘username’];
if(!isset($login_session))
{
$ses_sql=mysqli_query($obj->conn,"SELECT username FROM users WHERE username=’$user_check’ ");
$row=mysqli_fetch_array($ses_sql,MYSQLI_ASSOC);
?>[/php]