Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Logowanie na Cookies, problem ze skryptem logowania
Reiven
post 17.03.2006, 19:07:24
Post #1





Grupa: Zarejestrowani
Postów: 100
Pomógł: 1
Dołączył: 17.03.2006

Ostrzeżenie: (0%)
-----


Witam, po wielu mordęgach udało mi sie sklepać w skrypt logowania, lecz wyskakuje mi błąd:

Kod
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\WebServ\httpd\news\zaloguj.php:2) in C:\Program Files\WebServ\httpd\news\zaloguj.php on line 33

i nie wiem co złego zrobiłem.
oto kod:
Kod
<?php
include ('config.php');
$db = mysql_connect ("$host", "$login", "$pass");
mysql_select_db ($baza);

$login = $_POST['user'];
$haslo = $_POST['haslo'];

$query = "SELECT * FROM admin WHERE user='$user'; ";
$result = mysql_query ($query);
$ile_user = mysql_num_rows($result);

if ($ile_user > 0)
{
$query2 = "SELECT * FROM admin WHERE user='$user' AND haslo='$haslo';";
$result2 = mysql_query ($query2);
$ile_user2 = mysql_num_rows($result2);

if ($ile_user2 > 0)
{
setcookie ("user2_c", $user,time()+3600);
setcookie ("haslo2_c", $haslo,time()+3600);
header("Location: admin.php?s=zobacz");
}
else
{
header("Location: index.php");        
}
}
else
{
header("Location: index.php");
}

mysql_close ($db);
?>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 04:55