Hi..

very strenge issue. i am not getting session value across the pages. what i am doing is asking user to fill up a form and when he submits his/her form on the next page he/she can see the fields which are filled and when he submits on confirm data will go to the database. its so simple but i am not getting session values so everything is stucked. so please anyone here can tell me what i am missing here.?

1)addfriend.php

PHP Code:
<?php



session_start
();
ob_start();
if(
$_SERVER['REQUEST_METHOD'] == "GET")
   {


     
// $id                     = $_POST['id'];
      
$myname               "";
      
$friend1              "";
     

}
if(
$_SERVER['REQUEST_METHOD'] == "POST")
   {


     
// $id                     = $_POST['id'];
         
$myname               $_POST['myname'];
      
$friend1              $_POST['friend1'];
      
}

     if(
$_POST['submit'] == "submit"){

header("Location:addfriend_preview.php");

               }
?>
HTML Code:
<html>
<head>
<body>
<form action="<?=$PHP_SELF;?>" method="post" name="productFrm">

<div class="row">
		<label for="name">MyName:</label>
	  	<input type="text" name="myname" size="25" value="" />
  	 </div>
  <h4>My friends</h4>

	<div class="row">
		<label for="friend1">1</label>
		<input type="text" name="friend1"  size="25"  />
	</div><div class="row">
<span class="col6"><input type="submit"  name="submit" value="submit" class="button_style"   /></span>
<span class="col4"><input type="reset" value="Reset" class="button_style" /></span>
</div>
<div class="row">
<span class="col6"><input type="submit"  name="submit" value="submit" class="button_style"   /></span>
<span class="col4"><input type="reset" value="Reset" class="button_style" /></span>
</div>
</form>
 </div>
</div>


addfreind_preview.php
PHP Code:
session_start();
//ob_start();

echo $_SESSION['myname'];
echo 
$_SESSION['friend1'];



echo 
'Welcome to page #2<br />';




if(
$_SERVER['REQUEST_METHOD'] == "GET"){

                          echo   
$_SESSION['myname'];
                          echo   
$_SESSION['friend1'];
                          


      }
else if(
$_SERVER['REQUEST_METHOD'] == "POST")
           {

           if(
$_POST['submit'] == "submit")
                   {

           
// $id                     = $_POST['id'];
                
$myname             $_SESSION['myname'];
                
$friend1              $_SESSION['friend1'];
               
          }


    }
?> 
HTML Code:
<html>
<head>
<body>
<link rel="stylesheet" href="friends.css" type="text/css" />

<div id="wrapper">

 <div class ="header">
 	<img src="images/header.jpg"  alt="Logo" />
</div>

 <div class="rightcol">
 <form action="<?=$PHP_SELF;?>" method="post" name="productFrm">

	 <div class="row">
		<label for="name">MyName:</label>
	  	<input type="text" name="myname" size="25" value="<?=$_SESSION['myname'];?>" readonly />
  	 </div>
  <h4>My friends</h4>

	<div class="row">
		<label for="friend1">1</label>
		<input type="text" name="friend1" value="<?=$_SESSION['friend1'];?>"  size="25"  />
	</div><div class="row">
<span class="col4"><input type="submit" name="submit" value="submit" class="button_style" onClick="javascript:return fmvalidate();"  /></span>
<span class="col4"><input type="reset" value="Reset" class="button_style" /></span>
</div>
</form>
</div>
</div>
</body>
</html>
i am making this code short.please tell me why values are not getting passed to next page?