Forum Moderators: coopster
The problem is, the picture displayed is unknown.gif, not test.gif. In another word, when calling read_cookie.php as an image of test.html, the $_COOKIE["cookie_name"] variable returns ' ', not test.gif. Why? How to solve this problem?
edit: i thought you're outputting the binary data in the script read_cookie.php. but you're just redirecting, so this will not help you.
in case the redirection is the problem - what i think right now - you'll need to output the file instead of redirecting to it.
but redirecting should not be the problem at all, because it's http conform. please check which http version you use (1.0 or 1.1). in 1.1 it's a need to use full pathes like http://www.your.dom/images/test.gif instead of simply test.gif. maybe that's your problem.if you afterwards favorise a direct output without redirect, the code below might help you to get a start.
i think this is because "read_cookie.php" will return the so called content-type or mime-type text/html (default for php). you will need to replace it in the read_cookie.php script. add the following line in your script (it's important that this is done before any other output):
header('Content-type: image/gif');
[i]...
the output of binary data of the gif-file here
...[/i]
because i don't know your script in detail, this is only an assumption.
additionally you can return the size in bytes that way:
header("Accept-Ranges: bytes");
header("Content-Length: [i]number of bytes[/i]");
--hakre