Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php]Link a sesje
Robert
post
Post #1





Grupa: Zarejestrowani
Postów: 117
Pomógł: 0
Dołączył: 2.05.2003

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


Witam
Na stronie posluguje sie takimi linkami
Kod
<a href="index.php?page=admin">admin</a>
W momencie gdy mam ustawiona sesje w index.php to przy wywolaniu admina i przy logowaniu wyskakuje blad o zle podanym hasle. Lecz skrypt ten dziala na 100%. Moze byc to wina sesji??

Pozdrawiam
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Robert
post
Post #2





Grupa: Zarejestrowani
Postów: 117
Pomógł: 0
Dołączył: 2.05.2003

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


To jest taki prosty skrypt logujacy[php:1:78758d1301]<?php
session_start();
$adres_strony = "index.php?page=admin";
if ($haslo == "" || $login == "")
{
echo "<form action=$adres_strony method=post><br>";
echo "Login: <input type=text name=login><br>";
echo "Haslo: <input type=password name=haslo><br>";
echo "<input type=submit value=Loguj>";
}

if ($haslo=="kolo" && $login=="admin")
{
echo "<div align=center><b>Panel Administracyjny</b></div><br><a href=index.php?page=form_aktual>Dodaj aktualizacja</a><br><a href=index.php?page=edit_aktual>Edytuj aktualizacje</a><br><br><a href=index.php?page=form_newsy>Dodaj newsa</a>
";
}

elseif ($haslo!="" || $login!="")
{
echo "Złe hasło i/lub login<br>
<a href=$adres_strony>Spróbuj ponownie</a>";
}
?>
[/php:1:78758d1301]
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 8.10.2025 - 11:45