php3-list | 199901
Date: 01/30/99
- Next message: Pete Robinson: "Re: [PHP3] Win32 Apache 1.3.3 & PHP3 installation"
- Previous message: Michael Stearne: "Re: [PHP3] Win32 Apache 1.3.3 & PHP3 installation"
- Next in thread: Rasmus Lerdorf: "Re: [PHP3] using PHP to "pipe" image files"
- Reply: Rasmus Lerdorf: "Re: [PHP3] using PHP to "pipe" image files"
- Maybe reply: Richard Lynch: "Re: [PHP3] using PHP to "pipe" image files"
- Maybe reply: Zeba Kimmel: "Re: [PHP3] using PHP to "pipe" image files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello, all. Here is an interesting question.
I want to pipe non-HTML files, let us say image files, directly through php. How can I do this?
For example, let's say I type into my browser the URL "getimage.php3?name=myimage.jpeg". What I want is for getimage.php3 to return the file "myimage.jpeg" as an image. Something like this:
# contents of getimage.php3
<?php
header("Content-Type: image/jpeg");
$fp=fopen($name,"r");
fpassthru($fp);
fclose($fp);
# or could use readfile($name)
?>
# end
Then I can embed HTML tags that look like this:
<IMG src="getimage.php3?name=myimage.jpeg">
and voila, such a tag will result in the browser displaying the image contained in "myimage.jpeg".
The only problem is, the code above doesn't work, and I don't know why. I would be grateful for any advice.
Thanks!
--Zeba Kimmel, zkimmel <email protected>
--- Zebadiah Kimmel zkimmel <email protected>-- PHP 3 Mailing List http://www.php.net/ To unsubscribe send an empty message to php3-unsubscribe <email protected> To subscribe to the digest list: php3-digest-subscribe <email protected> For help: php3-help <email protected> Archive: http://www.php.net/mailsearch.php3 List administrator: zeev-list-admin <email protected>
- Next message: Pete Robinson: "Re: [PHP3] Win32 Apache 1.3.3 & PHP3 installation"
- Previous message: Michael Stearne: "Re: [PHP3] Win32 Apache 1.3.3 & PHP3 installation"
- Next in thread: Rasmus Lerdorf: "Re: [PHP3] using PHP to "pipe" image files"
- Reply: Rasmus Lerdorf: "Re: [PHP3] using PHP to "pipe" image files"
- Maybe reply: Richard Lynch: "Re: [PHP3] using PHP to "pipe" image files"
- Maybe reply: Zeba Kimmel: "Re: [PHP3] using PHP to "pipe" image files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

