hi
i am passing variables through php sessions but i am getting some problem in it.
in page1.php i m registering my session variable and in page2..php i need to access that value but ...
here is my code:
//page1.php
<?
session_start();
$name="deepak";
session_register("name");
?>
<a href="./page2.php">clickit</a>
//page2.php
<?
session_start();
echo "your name is:".$name;
?>
errors: page1.php
Warning: Cannot send session cookie - headers already sent by (output started at /home5/ns-home/docs/phtml/ci_tcs/test/test1.php:2) in /home5/ns-home/docs/phtml/ci_tcs/test/test1.php on line 4
Warning: Cannot send session cache limiter - headers already sent (output started at /home5/ns-home/docs/phtml/ci_tcs/test/test1.php:2) in /home5/ns-home/docs/phtml/ci_tcs/test/test1.php on line 4
clickit
error:page2.php
Warning: Cannot send session cookie - headers already sent by (output started at /home5/ns-home/docs/phtml/ci_tcs/test/test2.php:2) in /home5/ns-home/docs/phtml/ci_tcs/test/test2.php on line 19
Warning: Cannot send session cache limiter - headers already sent (output started at /home5/ns-home/docs/phtml/ci_tcs/test/test2.php:2) in /home5/ns-home/docs/phtml/ci_tcs/test/test2.php on line 3
your name is:
help me.. how to code these for passing variable throuh sessions and what is the method to pass an array through session from page1 and to access that array in page 2..
waiting 4 reply..
cheers deepak..