bazz
01-09-2008, 11:38 PM
Hi,
I am new to php and sessions. The following code seems not to want to work.
I have started the session and I am merely trying to check if a value exists and if so, to output it. if not, to state that the value has not been set.
Hopefully the code is close but I ask for your assistance please.
<?php
session_start();
if(isset($_SESSION['sessionStartTime']))
$sessionStartTime = ". $_SESSION['sessionStartTime'];
echo "sessionStartTime = $sessionStartTime<br />";
else
echo "sessionStartime has not been defined";
?>
here's the error which I do not undertsand
PHP Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/vhosts/myDomain/httpdocs/index.php on line 4, referer
bazz
I am new to php and sessions. The following code seems not to want to work.
I have started the session and I am merely trying to check if a value exists and if so, to output it. if not, to state that the value has not been set.
Hopefully the code is close but I ask for your assistance please.
<?php
session_start();
if(isset($_SESSION['sessionStartTime']))
$sessionStartTime = ". $_SESSION['sessionStartTime'];
echo "sessionStartTime = $sessionStartTime<br />";
else
echo "sessionStartime has not been defined";
?>
here's the error which I do not undertsand
PHP Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/vhosts/myDomain/httpdocs/index.php on line 4, referer
bazz