RE: [PHP] =.jpg from another URL with PHP=
| From: | Daniel Kushner | Date: | Fri, 11 Oct 2002 14:56:20 +0000 |
| Subject: | RE: [PHP] =.jpg from another URL with PHP= | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-119647@lists.php.net to get a copy of this message | ||
Save your first bit of code in a file (e.g.: image.php)
Your HTML file should look like this:
<html>
<head>...</head>
<body>
.....
<img src="image.php" .....>
....
</body>
</html>
Regards,
Daniel Kushner
_________________________________________
Need hosting? http://thehostingcompany.us
-----Original Message-----
From: Anthony Ritter [mailto:tony@gonefishingguideservice.com]
Sent: Friday, October 11, 2002 11:53 AM
To: php-general@lists.php.net
Subject: [PHP] =.jpg from another URL with PHP=
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 1034364214C
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