Hi,
I’m trying to create a login page. Here’s my code:
[php]
if (isset($_POST[“Submit”])){
$strUser = funcStripText($_POST[“txtUser”]);
$strPass = funcStripText($_POST[“txtPass”]);
if (($strUser != "")&&($strPass != "")){
$rsRow = mysqli_query($connBike, "SELECT UserID FROM tbl_Users WHERE Username='" . $strUser . "' AND UserPass='" . $strPass ."'");
if (mysqli_num_rows($rsRow)>0){
$rsDetails = mysqli_fetch_assoc($rsRow);
mysqli_free_result($rsRow);
mysqli_close($connBike);
session_start();
$_SESSION["UserID"] = $rsDetails["UserID"];
$intStatus = 1;
}
else{
$intStatus = 2;
}
}
}
[/php]
This seems to work fine, but as soon as I navigate to another page in the site it logs me out, almost as if there’s a session_destroy() on every other page, which there isn’t.
Any ideas what I’m missing?