how to use session()
Moderator: General Moderators
-
nishmgopal
- Forum Contributor
- Posts: 101
- Joined: Tue Mar 03, 2009 9:38 am
Re: how to use session()
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /disks/diskh/zco/conmg/public_html/go.php on line 12
Re: how to use session()
dont know how but i got it sorted with my editor
Code: Select all
session_start();
if(isset($_POST['job']))
{
echo "post value assigned to job is ".$_POST['job'];
$_SESSION['job']=$_POST['job'];
echo "SESSION VALUE ASSIGNED is ".$_SESSION['job'];
}
else
{
echo "POST VALUE NOT ASSIGNED TO JOB";
}
-
nishmgopal
- Forum Contributor
- Posts: 101
- Joined: Tue Mar 03, 2009 9:38 am
Re: how to use session()
Right that worked now. And I got the following output:
POST VALUE NOT ASSIGNED TO JOB
and the code you gave me to put on page2 is returning the below error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /disks/diskh/zco/conmg/public_html/find10a.php on line 65
The Code I have for page2 is:
POST VALUE NOT ASSIGNED TO JOB
and the code you gave me to put on page2 is returning the below error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /disks/diskh/zco/conmg/public_html/find10a.php on line 65
The Code I have for page2 is:
Code: Select all
<?php
session_start();
if(!isset($_SESSION['job']))
{
echo "job value is not set";
}
else
{
echo "JOB Value is set to $_SESSION['job']";
}
?>
Re: how to use session()
Code: Select all
//page2 code
session_start();
if(!isset($_SESSION['job']))
{
echo "job value is not set";
}
else
{
echo "JOB Value is set to". $_SESSION['job'];
}
Code: Select all
<form action="go.php" method="post">
-
nishmgopal
- Forum Contributor
- Posts: 101
- Joined: Tue Mar 03, 2009 9:38 am
Re: how to use session()
Thank you so much! It finnaly works!!
I cannot thank you enough, I have been struggling with this for far to long.

I cannot thank you enough, I have been struggling with this for far to long.