Jump to content
GIGN Forum

Session_Start


Dj_Stay
 Share

Recommended Posts

Lūūdzu palīdzat ar session_start(_); nekādīgi nesaprotu, kas pa problēmu tur ir :/

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\xampp\htdocs\index.php:1) in D:\xampp\htdocs\index.php on line 7

reku php scripts

<?php

include("config.php");

session_start();

if(isset($_GET['darbiiba']) and $_GET['darbiiba'] == 'iziet' and isset($_SESSION['ieligojies']))

{

session_destroy();

header("location: index.php");

}

if(isset($_POST['username']) and isset($_POST['password']))

{

$username = quote_smart($_POST['username']);

$password = quote_smart(md5($_POST['password']));

$result = mysql_query("SELECT COUNT(*) FROM lietotaji WHERE user = $username AND pass = $password");

if(mysql_result($result,0,'COUNT(*)') > 0)

{

#ieliek sesijā datus

$_SESSION['ieligojies'] = 1;

$id = mysql_result(mysql_query("SELECT id FROM lietotaji WHERE user = $username AND pass = $password"),0,'id');

$_SESSION['mans_id'] = $id;

}

}

?>

Link to comment
Share on other sites

Pārliecinies, ka pirms session_start();

nekur netiek izvadīts html`s.

Link to comment
Share on other sites

Nav, viņš virs <html>

Atkal vēlviens errors

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at D:\xampp\htdocs\index.php:1) in D:\xampp\htdocs\index.php on line 5
Edited by Dj_Stay
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...