Forum Moderators: coopster

Message Too Old, No Replies

How to pass a PHP page's echo as a value to a javascript function

         

cta684

7:46 pm on Jan 20, 2009 (gmt 0)

10+ Year Member


<a href="./includes/showfile.php?image_id='.$array['upload_id'].'" target="popup" onClick="wopen("./includes/showfile.php?image_id='.$array['upload_id'].'", 'popup', '$array['image_width']', '$array['image_height']'); return false;">

The section that requires fixing:
onClick="wopen("./includes/showfile.php?image_id='.$array['upload_id'].'"

showfile.php echos a mySQL BLOB image based on an upload_id passed to it from a mySQL DB:
echo $array['image'];

I'm looking for any kind of solution to this problem.

I'm trying to call up an image using showfile.php from a mySQL DB based on an upload_id, into a javascript function that will make it popup in its own window.

coopster

11:23 pm on Jan 21, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, cta684.

You need to send the appropriate image headers out first, then the image blob. How to convert image blob files back to image [webmasterworld.com]