how to display an image with php file showing pictures with php files

RegisterLogin
how to display an image with php file showing pictures with php files
Post Description: how to display an image with php file showing pictures with php files
Tags: how, to, display, an, image, with, php, file, showing, pictures, with, php, files
This Post Was Posted On Feb 29, 2008 By web hosting #1341
if you want to know how you can display image, pictures photos or pics using a php file you can use this

first create a php file called webune-image.php

now copy and paste the code below:

<?
# SCRIPT BY WEBUNE.COM - PHP HOSTING
# PLEASE DONT REMOVE THIS PART. THANK YOU

$ImgOutput = "absolute/path/to/image.jpg";

?>header ('content-type: image/jpg');
readfile($ImgOutput);

?>


now where it says $ImgOutput make sure to give the correct path where the image is located at

for example, if you have an jpg image in your images directory and your image is called default.jpg
you would declare it like this

$ImgOutput = "/var/www/html/images/default.jpg";


not like this: http://www.mywebsite.com/images/default.jpg

now open create another empty file called webune.html and copy and paste the following code:

<img src="http://www.mywebsite.com/webune-image.php" alt="created by webune">


now you want to open webune.html with your browser.

make sure to change mywebsite.com to whatever yous website is.

this is the very basic of a file, you can be more creative, but atleast it gives you a guide on how this works.
Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
©2011 Webune Forums - Wed Dec 21, 2011 3:09 am
Powered by: Webune Forums V3