I do not want to show the real URL of the images. Therefore, I use uniqueid()to replace the URL of dynamic images and keep the real URL against uniqueid()in the session. So I get the load uniqueids => real-image-path.jpgin the session array. Then, using the following code for the echo image:
<img src="getImage2.php?h=<?php echo $uniqueID; ?>" title="" >
It all works. As getImage2.phpI'm wondering how I can use variables that are stored in the session for the echo picture. I have:
session_start();
header("Content-Type: image/jpeg");
while($_SESSION[$uniqueID]){
echo readfile($_SESSION[$uniqueID]);
}
But it looks pretty hopeless and obviously doesn't work. What is the best way to echo an image in getImage2.php?
An example session array is as follows:
Array ( [start] => 1435057843
[start_date] => 23/06/15
[start_time] => 12:10:43
[b312a3f205176aa006c8712b3aedb2a4] => images/1370322222.jpg
[5311d8a77e3889723a61b3768faaa4df] => images/1357323650.jpg
[fa14a6a315bf7ddbeb7390af23467f5e] => images/1415737586.jpg
[dd624079e982d78e538f873b7719f179] => images/1369865823.jpg
[5c4011114f6abbb9ecaf2ffbe4d3936f] => images/1369885151.jpg
[d26e3a017ce4851a19511fc0dfedc595] => images/1370317410.jpg
.............
source
share