Undefined index

hello , please i am having an undefined index for a script that works well on my host server, it is giving error

Notice: Undefined index: username in /Users/mgltd/Sites/reacheasy/include/header.php on line 23
Notice: Undefined index: username in /Users/mgltd/Sites/reacheasy/include/header.php on line 42

from my header script the mark up is below

<?php require_once("include/session.php");?>
<?php require_once("include/functions.php");?>
<?php include("include/header.php");?>

this is the header script

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
     <title>Reacheasy - Foremost website for shopping from Uk, and globally to Nigeria</title>
   <meta name="description" content="We offer online shopping and shipping from UK stores to Nigeria" />
    <meta name="keywords" content="shipping to nigeria, freight to nigeria,online shopping from uk" />


    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<link href="reasy.css" rel="stylesheet" type="text/css"/>
</head>
  <body>
<div id="outer">
<div id="page">
<div id="header">
<!--<div id="adban" style="position: absolute; left: 50%; margin-left: -150px;">
<span style="left;"><a href="reregister.php">Click here to Register now and place your orders</a></span>
</div>-->
<div id="hlogo">
<!--<span style="float:right;"><img src="img/relogo2.jpg"  class="logoImage" width="96" height="96"/></span>-->
<span style="float:right;margin:2px 2px 0 0;"><img src="img/relogo1.jpg"  class="logoImage" width="96" height="96"/></span>
</div>
<span style="font-size:small;text-shadow: 10px 10px 1px grey;"><h1>Reacheasy<span style="font-size:small;">
<?php echo $_SESSION['username'];?>
</span></h1></span>
<!--<span style="float:left;"><img src="img/rewordlogo.jpg"/></span>-->
<ul id="nav">
    <li class="current"><a href="index.php">Home</a></li>
     <li><a href="women.php">Women</a></li>
     <li><a href="men.php">Men</a></li>
     <li><a href="children.php">Children</a></li>
     <li><a href="homeandappliances.php">Home&amp;Appliances</a></li>
     <li><a href="visionandsound.php">Vision&amp;Sounds</a></li>
      <!--<li><a href="motoring.php">Motoring</a></li>-->
      <li><a href="homemore.php">More</a></li>
      <li><a href="freight.php">Freight</a></li>
      <li><a href="howto.php">Help(How to?)</a></li>
  </ul>
</div> <!--end of navigation div -->
</div>
<div id="navigation">
<?php
if($_SESSION['username'])
{ ?>
<ul id="navigationlb">
<li><a href='howto.php'>Help(How to?)</a></li>
<li><a href='notification.php'>Consignment notification</a></li>
<li><a href='youraccount.php'>Order Placement</a></li>
<li><a href='relogout.php'>Log out</a></li>
 </ul>
<?php }else{
?>
 <div>
<form action='relogin.php' method='post' class='rl'>
<fieldset>
<legend>Login</legend>
	<div>
	<label for='username' class='fixedwidth'>Username</label>
	<input type='text' name='username' id='username'/>
	</div>
	
	<div>
	<label for='password' class='fixedwidth'>Password</label>
	<input type='password' name='password' id='password'/>
	</div>
<div class='buttonarea'>
	<input type='submit' value='Log in'/>
	</div>
<p>
<a href='reregister.php'>Register </a>
<span style="font-family:Arial,Helvetica,sans-serif;color:#5CB3FF;"><BR>PLACE YOUR ORDERS FROM ANYWHERE</BR>
IN THE WORLD </BR> TO NIGERIA</span>
</p>
<!--<p>
<BR>PLACE YOUR ORDER FROM ANYWHERE</BR>
IN THE WORLD </BR> TO NIGERIA
</p>-->
</fieldset>
</form>
</div>
<?php
}
?>

Use isset() to check for the existence of a value


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

it worked thanks, @mike, whats the difference between the two, because the previous mark up was working fine on line

Using if() blindly looks for a value and if it’s not there it just spits out an error message. isset() will determine if the variable is there or not and return either true or false.
It might be that your previous server had error reporting turned down or even off.