Co tu jest zle ?

Rozmowy z innymi użytkownikami forum na różne tematy, niekoniecznie związane ze skryptem phpBB.
damianz121
Posty: 3
Rejestracja: 28 grudnia 2006, 09:04

Co tu jest zle ?

Post autor: damianz121 » 28 grudnia 2006, 09:35

Powiedzcie mi co tu jest zle, nie moge sie zalogowac do PA:

Kod: Zaznacz cały

$login = $admin_login="1a";
$haslo = $admin_pass="1a";

if (!$_POST["username"] or !$_POST["password"]) {
echo "<a href='../index.php?body=zaloguj'>Nie wypełniłeÅ› wszystkich pól!</a>";
exit;
}

if ($_POST["password"] == $haslo && $_POST["username"] == $login) {
echo 'ZalogowałeÅ› się poprawnie!';
$_SESSION["auth_username"] = md5(uniqid(rand(), true));

header("Location: ../admin/index.php");
}
else {
echo "<a href='../index.php?body=zaloguj'>Logowanie nieudane.</a>";
}
?>

Awatar użytkownika
daroPL
Zasłużony
Posty: 4564
Rejestracja: 24 czerwca 2005, 13:36
Lokalizacja: Poznań
Kontakt:

Post autor: daroPL » 28 grudnia 2006, 09:41

Kod: Zaznacz cały

<?php
session_start();

$login ='1a';
$haslo = '1a';

if (!$_POST["username"] || !$_POST["password"]) {
echo "<a href='../index.php?body=zaloguj'>Nie wypełniłeś wszystkich pól!</a>";
exit;
}

if ($_POST["password"] == $haslo && $_POST["username"] == $login) {
echo 'Zalogowałeś się poprawnie!';
$_SESSION["auth_username"] = md5(uniqid(rand(), true));

header("Location: ../admin/index.php");
}
else {
echo "<a href='../index.php?body=zaloguj'>Logowanie nieudane.</a>";
} 
może teraz?

damianz121
Posty: 3
Rejestracja: 28 grudnia 2006, 09:04

Post autor: damianz121 » 28 grudnia 2006, 09:47

Tak teraz powinno mnie przekierowac do panelu a w admin/ index.php mam coś takiego i nie wchodzi:

Kod: Zaznacz cały

<?
session_start();
ob_start();
if(!isset($_SESSION["auth_username"])) 
	{
	header("Location: ../index.php");
	}
else {

include '../config.php';
include 'update.php';
if (!defined('admin')) define('admin', 1);
?> 
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-2">
<meta http-equiv="Reply-to" content="illarion@wp.pl">
<meta http-equiv="Content-Language" content="pl">
<meta name="Author" content="Isecross">
<link rel="stylesheet" href="../style.css" type="text/css">
<title>Acc Maker do <?=$nazwa_serwera ?> - <?=$title ?></title>

</head>
<body>
<? include '../includes/config.php';?>
<table border="1" width="600" class="mon" align="center" bordercolor="black">
<tr>
<td colspan="2"><img src="../img/logo.gif"></td>
</tr>
<tr>
<td width="20%">
<div STYLE="width: 99%; height="220" margin-right: 4px; margin-left: 4px; overflow: auto;">
<center><img src="../img/linia.png"></center>
<center>
<img src="../img/menu.gif">
</center>
<center><img src="../img/linia.png"></center>
<? include("includes/menu.php")?>
</div>
<center><img src="../img/linia.png"></center>
</td>
<td>
<div STYLE="width: 99%; height: 420px; margin-right: 4px; margin-left: 4px; overflow: auto;">
<center>
<?
$body=$_GET["body"];



if ($body=="")
       {
       include("main.php");
       }

else {

if (is_file("includes/$body.php"))
		{
          include("includes/$body.php");
        }  
  
else
	    {
            include("../includes/error.php");
		}	
        }                              
?>
</center>
</div>

</td>
</tr>
<td colspan="2">
<center>
<? include("../includes/copyrights.php")?>
</center>

</td>
</table>
</body>
</html>
<?
		}
?>


[ Dodano: 28 December 2006, 08:50 ]
Najlepiej prosiłbym o skrypt który mnie zaloguje do PA...

dziolecki
Posty: 13
Rejestracja: 25 października 2006, 14:30
Kontakt:

Post autor: dziolecki » 28 grudnia 2006, 13:03

Witam ja z nim pisze portal i chciałem was prosić o jakiś skrypt do logowania, aby zalogował do PA!

ODPOWIEDZ

Wróć do „Ogólne dyskusje”