Hello, I have a really weird session problem that I can't figure out.
I have a script that creates a random image (randomimage.php). This script generates a random number ($rand_num) and registers it with the session.
I call randomimage.php from another script using <img src=randomimage.php> This same script needs to use the session variable $rand_num in it. However, in the calling script the session variable $rand_num always displays the previous variable and not the current one.
The calling script looks like this:
<?php
session_start();
?>
<html>
<head>
</head>
<body>
<img src="randomimage.php">
<br>
<?
session_register("rand_num");
echo $rand_num;
?>
</body>
</html>
Does anyone know the cause of this problem?