PHP Session won't start : <p>I'm having problem with starting a session in PHP. By looking around I wrote some code that should work but it doesnt. Can you please help me out because I don't know what's wrong here. This is my loging.php page</p>

<pre><code>    &lt;?php

$host = "localhost";
$user = "usern";
$password = "gtest123";
$db = "test";
$errore = "Login info are wrong!`enter code here`";

mysql_connect($host,$user,$password);
mysql_select_db($db);

if(isset($_POST['username'])){

    $username = $_POST['username'];
    $password = $_POST['password'];

    $sql = "select * from utenti where username = '".$username."' AND Password = '".$password."' limit 1";

    $result = mysql_query($sql);

        if(mysql_num_rows($result)==1){
            $_SESSION['username'] = $username;
            header("location:index.php");
        }

        else{
            echo "" .$errore;
        }`enter code here`
}

    ?&gt;
</code></pre>

<p>I than have my db with users on phpmyamin and the login it's working. The problem is when I load the index.php page.</p>

<pre><code>&lt;?php
    session_start();
    echo "Welcome" .$_SESSION[''];
?&gt;
&lt;html&gt;
all the html code
</code></pre>

<p>I start this session because I want to be able to see which user do certian function in the website. However I get this error message:
Notice: Undefined index:
I know what the error means but I don't know how to fix it, any help?</p>
