Jump to content

Login trouble


spInGoBlin

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.