karq Posted August 9, 2008 Share Posted August 9, 2008 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 More sharing options...
papaface Posted August 9, 2008 Share Posted August 9, 2008 if ($q["kasutaja"]==$kasutaja && $q["parool"]==$parool) <--- or here { $_SESSION["sees"]; What does this session var do? I can see it isn't being assigned to anything. Link to comment https://forums.phpfreaks.com/topic/118913-problem-with-sessions/#findComment-612310 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.