<?php
session_start();
if (isset $_SESSION['user']){
$labelregister="";
$labellogin ="";
$labeluser=$_SESSION['user'];
}
?>
label changes if session exists
Question
i'm building an website of sales and i need accounts for costumers and if the login is done
session_start();
include ("connbd.php"); where ligabd is the connection to the database
$query = "SELECT * FROM clientes WHERE utilizador = '".$user."' AND pass = '".$pass."'";
$result = mysqli_query($connbd,$query);
$count = mysqli_num_rows($result);
if (!$result) {
$_SESSION['user']=$user;
$_SESSION['password']=$pass;
header("location:index.php");
}
now in the index page i have the label login and register, my question is how with:
if isset $_SESSION['user']
label register="" & label login =""
labeluser=$_SESSION['user']
how do i solve this?
Solution
OTHER TIPS
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow