spInGoBlin Posted April 27, 2006 Share Posted April 27, 2006 If you can, please compare 2 pages:1. [a href=\"http:///www.noon.ee/dbase/addrecord_wlog.php\" target=\"_blank\"]page with login/session_start[/a]2. [a href=\"http://www.noon.ee/dbase/addrecord_woutlog.php\" target=\"_blank\"]page without login/session start[/a]The goal is to display an extra row if certain (admin rights) people are logged in (based on SQL row "admin_rights"). Piece of "login.php":[code] if($password == $row["password"]) { $_SESSION['adminok'] = "bad"; $_SESSION['username'] = "username"; $_SESSION['password'] = "password"; header("Location: admin.php"); if ($row['admin_rights'] == 1) { $_SESSION['adminok'] = "good"; }[/code]This far it works, the extra row is there:[code]<?php if ($adm == "good") {echo '<tr><td class="tableheader" width="50%">Müügiarve?</td><td class="tablecont" width="50%"><select name="selectSales" onclick="Refresh(0)" size="1">'; echo '<option value = 1>Jah</option>'; echo '<option value = 0>Ei</option>';echo '</select></td></tr>';} else {};?>[/code]But the other goal is for the form to refresh whenever a field is changed, displaying different results. This works in [b]addrecord_woutlog.php[/b] but not in [b]addrecord_wlog.php[/b]. And there is only one difference as far as I can see:addrecord_woutlog.php:[code]checklogin();session_start();$adm=$_SESSION['adminok'];[/code]addrecord_wlog.php:[code]//checklogin();//session_start();$adm=$_SESSION['adminok'];[/code]Everything else is the same.Can anyone please help me to pin the problem? Can there be a problem with the session_start()? Is there anything I'm missing/not aware of? Thank you. Link to comment https://forums.phpfreaks.com/topic/8580-login-trouble/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.