|
problem related to php (please read my question -
December 25th, 2007
carefully before replying).? I am having 2 php pages as follows:
1. random_code.php in which a number is generated by certain way.
2. index.php in which this random_code.php file is called.
random_code.php contains:
----------------------
<?php
session_start();
$chars = 'abcdefghijklmnopqrstuvxyz0123456789'; // possible characters
$max = strlen($chars) - 1;
for ($i=0; $i<8; $i++) {
$position = rand(0, $max);
$code[] = $chars{$position};
}
$code = implode('', $code);
$_SESSION['codes']=$code;
/* below are the coded that will generate the image"
which i am not writing here*/
?>
index.php contains:
----------------------
<?PHP session_start(); ?>
<img src="random_code.php" alt="random code">
<?php
echo $_SESSION[codes];
?>
now what i want is that the number generated in random_code.php should be available in index.php for further action. tell me how to do this.
Plz Read my question carefully before replying.
|