Sunday, April 25, 2010

some session code for joomla

<?php
$session =& JFactory::getSession();
echo"<pre>";
$session->set( 'myvar', 'helloworld' );
print_r($session);
print_r($_REQUEST);
echo 'Session variable myvar has value: ' . $session->get( 'myvar', 'empty' );
$temp_session = $_SESSION; // backup all session data
print_r($temp_session);

/*
if (isset($_SESSION["name"]))

{ echo "Welcome " . $_SESSION["name"] . "!<br />"; }

else

{ header ("location: http://www.mydomain.com/joomla/index.php"); }

*/

?>

No comments:

Post a Comment