Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Images

Output an image in HTML page with php

images php coding issues or problems here.

Moderators: macek, egami, gesf

Output an image in HTML page with php

Postby 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
WoozyDuck
New php-forum User
New php-forum User
 
Posts: 191
Joined: Wed May 05, 2004 10:14 am

Postby 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
ruturajv
php-forum Super User
php-forum Super User
 
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India

Postby WoozyDuck » Tue Feb 01, 2005 4:37 am

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


Return to PHP coding => Images

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron