# DOn't know whats the problem! PHP

**URL:** <https://forum.kirupa.com/t/dont-know-whats-the-problem-php/251856>\
**Category:** Uncategorized\
**Created:** [February 13, 2008, 8:27am UTC](https://forum.kirupa.com/t/dont-know-whats-the-problem-php/251856 "2008-02-13T08:27:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![onmosh](https://avatars.discourse-cdn.com/v4/letter/o/958977/32.png) [@onmosh](https://forum.kirupa.com/u/onmosh)\
**Post date:** [February 13, 2008, 8:27am UTC](https://forum.kirupa.com/t/dont-know-whats-the-problem-php/251856/1 "2008-02-13T08:27:34Z")

</div>

this is the code:

```php
<?php
require_once "dbconfig.php"; 
$sql = mysql_query("SELECT * FROM users11 WHERE username='".addslashes($_POST['username'])."'") or die("username was in correct. MySQL said".mysql_error());
$result = mysql_fetch_array($sql);

if($result['password'] == sha1($_POST['password'])) {
    session_start();
    header("Cache-control: private");
    $_SESSION[”sessioname”] = $_POST[’username’];
    header("location: protected.php");
}else{
    echo "Incorrect login details please try again.";
}

?> 

```

this is the output:  
**Warning** : session\_start() [[function.session-start](http://localhost/login2/function.session-start)]: Cannot send session cache limiter - headers already sent (output started at E:\xampp\htdocs\login2\dbconfig.php:4) in **E:\xampp\htdocs\login2\login.php** on line **7**

**Warning** : Cannot modify header information - headers already sent by (output started at E:\xampp\htdocs\login2\dbconfig.php:4) in **E:\xampp\htdocs\login2\login.php** on line **8**

**Warning** : Cannot modify header information - headers already sent by (output started at E:\xampp\htdocs\login2\dbconfig.php:4) in **E:\xampp\htdocs\login2\login.php** on line \*\*10

can’t figure it out what’s the problem… any idea guys?  
\*\*
