Dear coders,
I would be very glad if you could help me with this problem.
I cannot use cookies, sessions or html <img command and I would like to display an image while running index.php and keep executing the script but it stops when I include test.php. Any ideas to solve this ?
Thanks
Conditions:
// NO COOKIES, NO SESSIONS
// NO <img src=’teste.php?id=fox1’…
FILE 1 index.php
$id='fox1';
include ("test.php");
image_display($id);
// PROBLEM HERE!
// code stops in the line above. doesn’t execute the lines below
echo "output: ".$id;
echo “THE END”;
FILE 2 test.php
function image_display($id){
$ch = curl_init("http://www.google.es/images/firefox/".$id.".gif");
if (!$ch) { die( "Cannot allocate a new PHP-CURL handle" ); }
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
$data = curl_exec($ch);
curl_close($ch);
header("Content-type: image/jpeg");
print ($data);