Jump to content
php.lv forumi

Sesijas


hackerman

Recommended Posts

Ir fails, kas apstrādā login informāciju :) Pieņemsim, ka tas ir login.php

 

<?php
session_start();
include('config.php');

$lietotajvards = $_POST['lietotajvards'];
$parole = md5($_POST['parole']);
$kverijs = "select * from lietotaji where lietotajvards='$lietotajvards' and parole='$parole'";
$iznak = mysql_query($kverijs);

if (mysql_num_rows($iznak) != 1) {
$error = "Nesanaca";
echo "<script> alert('nepareiza parole un/vai lietotajvards!'); window.back()</script><br>";

} else {
$_SESSION['lietotajvards'] = "$lietotajvards";

include "fails.php";
}

?>

 

Kad ielogojos man rāda erroru:

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at login.php:2) in login.php on line 17
 

 

wtf?

Link to comment
Share on other sites

×
×
  • Create New...