Re: [PHP4BETA] Enhancement Request
| From: | php4 at developersdesk dot com | Date: | Wed, 31 May 2000 02:38:56 +0000 |
| Subject: | Re: [PHP4BETA] Enhancement Request | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-15962@lists.php.net to get a copy of this message | ||
Addressed to: Szii <szii@earthlink.net>
php4beta@lists.php.net
** Reply to note from Szii <szii@earthlink.net> Tue, 30 May 2000 23:02:57 -0700
>
> Application: Pulling .jpg files out of a database into the in-memory
> file and then exported directly to the html.
>
> Workarounds: 1) Not putting image files in the database 2) Export
> to a temp file and use <img src=x.jpg> 3) Separate .php file using
> header(image/jpg) and use <img src=xxx.php?id=y>
>
> Just wishing for a "clean solution." Best bet so far is just calling
> an external php file with ? params. Wish I could just call one of my
> classes member methods to load/dump it instead of having to hack my
> way with external files. 1 4line snippet of code for a whole file
> gets kinda annoying.
>
> I can put it in the DB, get it out, but it's becoming a PITA to
> display it properly. Maybe someone can suggest a workaround?
>
The best option I know of is option 1. The only reason I'd consider
leaving the image in the database is if other (non-web) programs also
use the images from the database. The consensus I've seen on this list
is leave the image in a file, and store the filename in the database.
I don't think there is much the php developers can do with this
problem, it is the way browsers work, and would require changes to the
html standards.
> -Szii
>
> An another note:
>
> print "<img src=\"$ad->OutputPhoto($cat,$valObject->AdID)\">";
> echo
> $ad->OutputPhoto($cat,$valObject->AdID); print
> "$ad->OutputPhoto($cat,$valObject->AdID)";
>
> The first "print" call says UndefinedProperty: OutputPhoto The "echo"
> call works as expected. The second "print" call works as expected.
>
> Can anyone explain why being inside the <img src=> tag would cause it
> to become an undefined property?
<Wild guess alert>
It is not the <IMG tag that messes it up, it is the quotes. You can't
dereference objects in qoutes. Try something like
print '<img src="' . $ad->OutputPhoto($cat,$valObject->AdID) .
'">';
</wild guess>
I don't use objects, but I've seen this one go by on the list several
times...
Rick Widmer
http://www.developersdesk.com
>
> -- PHP 4.0 Beta Mailing List
> <http://www.php.net/version4/> To
> unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net For
> additional commands, e-mail: php4beta-help@lists.php.net To contact
> the list administrators, e-mail: php4beta-admin@lists.php.net
>
>