0

Hi guys.

i am having problem regarding of passing session data from one page to another. In start.php i have this session initialization & assignment.

session_start();

$_SESSION['course']=$_POST['course'];

where the method of the form that this course menu has is set to POST and the action is set to login.php.

At login.php, when i echo the session data that was passed it is null. Why.?

I did it like this:

session_start();
$coursesel=$_SESSION['course'];
echo $coursesel;

Echo returns null but when i echo the $_SESSION in start.php it shows the data assigned to it.

Pls help guys.

Tnx for giving time.

God bless.!

Edited by blocker: n/a

3
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by blocker
0

At login.php, when i echo the session data that was passed it is null. Why.?

Do you have cookies enabled? Also does $_POST exist? And is $_POST a radio button? You need cookies enabled for sessions to work and as for radio buttons, sometimes they will return null if no option is selected or not used properly. I would suggest checking if $_POST has the same value as $_SESSION.

0

thank you for the suggestion..Ive switch to form variables..

Instead of using sessions, i use this method:

$coursesel=$_POST['course'];

In second page. This works. Thank you..

Edited by blocker: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.