Output an image in HTML page with php

images php coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
User avatar
WoozyDuck
New php-forum User
New php-forum User
Posts: 191
Joined: Wed May 05, 2004 10:14 am

Output an image in HTML page with php

Post by WoozyDuck » Mon Jan 31, 2005 10:40 am

Hi

I know how to make an output in HTML page making with PHP

Code: Select all

 $pageContent = date("l dS of F Y h:i:s A");
 print( "document.write( \"" . $pageContent . "\" );" );


and then this code in HTML file

Code: Select all

<script language="JavaScript" src="out.php" type=text/javascript></script>


I tried to show some image but it doesnt work if you just use image tag or something, could anybody please tell me how to show an output image using PHP in HTML page?
:help:

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Post by ruturajv » Mon Jan 31, 2005 7:49 pm

your html page

Code: Select all

...
<img src="/image_display.php" alt="the image" />
...


your image_display.php

Code: Select all

<?php
$img = imagecreate(...)
...
image processing
...
//finally
header('Content-Type: image/png');
imagepng($img);
?>

User avatar
WoozyDuck
New php-forum User
New php-forum User
Posts: 191
Joined: Wed May 05, 2004 10:14 am

Post by WoozyDuck » Tue Feb 01, 2005 4:37 am

cheers

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest