First of all you have to open this file as a binary
e.g. fopen("myfile.jpg","rb");
then you shound send the apropriate html headers to display the image
e.g. header("Contet-type: image/jpeg");
"Anthony Ritter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> The following script picks up single .jpg image of a doppler weather map
> from another URL:
> .......................................
> <?
>
$theURL="http://image.weather.com/web/radar/us_har_closeradar_medium_usen.jp
> g";
> if(!($fp=fopen($theURL, "r")))
> {
> print("Could not open the URL.");
> exit;
> }
> $contents=fread($fp,1000000);
> print($contents);
> fclose($fp);
> ?>
> ......................................
>
> However, when I try to insert the HTML tages into the script like:
>
> ......................................................
> <HTML>
> <HEAD>
> <BODY>
> This is a map.
> <?
>
$theURL="http://image.weather.com/web/radar/us_har_closeradar_medium_usen.jp
> g";
> if(!($fp=fopen($theURL, "r")))
> {
> print("Could not open the URL.");
> exit;
> }
> $contents=fread($fp,1000000);
> print($contents);
> fclose($fp);
> ?>
> </BODY>
> </HTML>
> ..........................................................
>
> I get the following:
> ����JFIF�� 1034364214��C
>
2!=,.$2I@LKG@FEPZsbPUmVEFd^emw{�,�N`�-O}-s~�|��C;!!;|SFS
>
||||||||||||||||||||||||||||||||||||||||||||||||||��)�"��
> ��H!1A"Qaq�#2'�BR���3��$br�45CSs'
> "DTt,cf�������*!1AQ"aq2B�'������
> ?�z_Y�<M�m �L�?�W"�-O�x�x�'�~~?�|��s
> �y��7þ?����xb�۰�,�}`��!W-�$g�N�&�jI�'�ZT�Ѷ�S�D
> Q�-y�+Q>_�L{M2I��ԍ3�q�!
> etc. etc...
>
> I would like to insert additional text copy with this map - is this
> possible.
>
> Thanking all in advance.
> Tony Ritter
>
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php