RE: [PHP] why this function is returning null
| From: | Vicky Atkinson | Date: | Fri, 07 Jul 2000 16:26:21 +0000 |
| Subject: | RE: [PHP] why this function is returning null | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-5404@lists.php.net to get a copy of this message | ||
You have a typing error where you echo the session...
echo "$ession";
Vicky
-----Original Message-----
From: hassan omar [mailto:ho1@postmaster.co.uk]
Sent: Friday, July 07, 2000 9:18 AM
To: php-general@lists.php.net
Subject: [PHP] why this function is returning null
I copied the following function from "core php". it is returning nothing.
what is wrong??? please help
<?php
function sessionId($len=8)
{
$pool = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$pool.= "abcdefghijklmnopqrstuvwxyz";
srand((double)microtime()*1000000);
for($i = 0; $i < $len; $i++)
{
$sid .= substr($pool, (rand()%(strlen($pool))),1);
}
return($sid);
}
# srand(time());
$session = sessionId(8);
echo "There is a sessionId set<br>";
echo "you will see it<br>";
echo "$ession";
echo "</body>";
echo "</html>";
?>
Thank in advance
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net