Jump to content

problem with sessions


karq

Recommended Posts

So I have a problem with sessions. I want to make so that when a user logs in then it creates a session and it dosent expire until he logs out.

But now when I run this code and I log in and make a refresh on that place then it says "mine tagasi". look down

<?php
session_start();
include "db.php";
//Võtame formi data
$kasutaja=$_POST["kasu"];
$parool=$_POST["pass"];
//Kontrollime kas andmed klapivad ja teeme sessioni
if (!isset($_SESSION["sees"]))
{
$kont=mysql_query("SELECT * FROM sisu",$con);
while ($q=mysql_fetch_array($kont))
{
if ($q["kasutaja"]==$kasutaja && $q["parool"]==$parool)  <--- or here
{
$_SESSION["sees"];
echo "<center><b>Tere Tulemast!" . $kasutaja . "</b></center>";
} //kontroll
else {
echo "mine tagasi";  <--the problem is somewhere here.
}
} //while
} //isset if
else {
echo "sees";
}
?>

Link to comment
https://forums.phpfreaks.com/topic/118913-problem-with-sessions/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.