Subject: what is <?=SID?>
Posted By: isheikh Post Date: 11/1/2004 9:45:26 PM
I am doing something like this on my home page, setting session variable.


if(!isset($_SESSION["id"]))
{
$cart_id = md5(uniqid(rand()));
    
$_SESSION['id'] = $cart_id;
}
**********

Someone told me i do not need to do this i should use

<?=SID?>

I did something like this but it did not print anything
echo "<?=SID?>";

thanks



Reply By: Snib Reply Date: 11/2/2004 8:23:56 PM
No no, he meant not to print that text, but to just have:

<?=SID?>

in the middle of a PHP page (outside the <?php ?>)

What this does is echo the PHP session id variable. It is recommended that you instead use

<?php echo SID; ?>

to avoid use of short tags.

Read this page for more info about PHP session handling:

http://www.php.net/session-start

HTH!

-Snib
Where will you be in 100 years?
Try new FreshView 0.2!
The two rules: 1) I am always wrong. 2) If I'm right, refer to rule number 1.

Go to topic 21509

Return to index page 726
Return to index page 725
Return to index page 724
Return to index page 723
Return to index page 722
Return to index page 721
Return to index page 720
Return to index page 719
Return to index page 718
Return to index page 717