我正在建立一个销售网站,我需要客户帐户,如果登录完成
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");
}
现在在索引页面我有标签登录和注册,我的问题是如何使用:
if isset $_SESSION['user']
label register="" & label login =""
labeluser=$_SESSION['user']
我该如何解决这个问题?
答案 0 :(得分:1)
答案 1 :(得分:1)
<?php
session_start();
if (isset $_SESSION['user']){
$labelregister="";
$labellogin ="";
$labeluser=$_SESSION['user'];
}
?>