Re: Include after image or a way to reset header

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Call the image rendering from another page and then let that page continue:

caller.php:
if ( $is_logged_in )
{
echo "<p align=\"center\"><img border=0
src='showimage.php?id=$get_pic&p=$from' alt=\"Photo name:
$get_pic\"></p>";
if ( $get_name != "" )
echo "<p align=\"center\">$get_name</p>";
}

showimage.php:
<?php
$_htmlfiles = "/home/domain/html/" ;
$fn = $_GET['id'];
$p = $_GET['p'];
$img = $_htmlfiles . "p/" . $p . "/" . $fn ;
$render = @imagecreatefromjpeg( $img );
header("Content-type: image/jpeg");
imagejpeg($render,'',100);
imagedestroy ($render);
?>

Gerry


On 2/3/06, tedd <tedd@xxxxxxxxxxxx> wrote:
> Hi:
>
> This is probably an obvious question, but after you create an image,
> how can you include another php  script?
>
> For example, if my code ends like so:
>
> header("Content-type: image/png"); // Set display mode as PNG
> imagepng($im); // Display image
> imagedestroy($im); // Delete image from memory cache
> ?>
>
> How can I redirect program flow to the next script, such to include
> "part2.php";
>
> If I place an include statement after imagedestroy statement, nothing happens.
>
> I suspect that it's because I have already set and sent the header --
> so, is there a way for me to reset the header so that I can launch
> the next script?
>
> Many thanks for any replies.
>
> tedd
>
> --
> --------------------------------------------------------------------------------
> http://sperling.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Gerry
http://portal.danen.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux