HI,
i have problem with login to website. I have two files. (index.php and functions.php)
index.php *********************
[php]<?
$islogin=1;
include “dbc.class.php”; // připojení k databázi
include “functions.php”;
echo <<< HTML
Administrace| Uživatelské jméno: | |
| Heslo: | |
?>[/php]
functions.php************
[php]<?php
if ($akce==“login”) {
$query=mysql_query(“SELECT jmeno,heslo,id FROM brigadnici WHERE jmeno=’$_POST[jmeno]’ AND heslo=’$_POST[heslo]’”);
if (mysql_num_rows($query)==1) {
$brigadnici=mysql_fetch_array($query);
session_register(“id”);
$_SESSION[‘id’]=$brigadnici[id];
session_register(“jmeno”);
$_SESSION[‘jmeno’]=$brigadnici[jmeno];
session_register(“heslo”);
$_SESSION[‘heslo’]=$brigadnici[heslo];
$t=time();
mysql_query(“UPDATE brigadnik SET lastlogin=’$t’ WHERE id=’$brigadnici[id]’”);
header(“Location: /uprava_firem/upravafirem.php”);
exit;
} else {
header(“Location: index.php”);
exit;
}
}
?>
[/php]
When i give bad name or bad pass i must have a go it repeat, but when i give it good, i must have a go it again. I don’t know why. Please can you help me ?