Jump to content
php.lv forumi

session_start


Frozen Life

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 cookie - headers already sent by (output started at D:\xampp\htdocs\index.php:1) in D:\xampp\htdocs\index.php on line 5

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;
       }
}

?>

Edited by Frozen Life
Link to comment
Share on other sites

Atkal problēma :D

Tā, tad man ir tā es ieeju savā profilā pārmet viss notiek un nemet lauka, ja, bet kad es izeju man viņš iziet, bet kad uzspiežu SĀKUMS atkal viņš ir profilā, bet kad uzspiežu piemēram komentēt jaunumus, tad viņš vairs nav profilā :/

Var kāds ar šito palīdzēt ? O_O

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...