image display problem

GD and GD2 are useful libraries for creating graphics on-the-fly. Discuss your PHP GD and GD2 scripts here.

Moderators: onion2k, General Moderators

Post Reply
itsmeranu
Forum Newbie
Posts: 1
Joined: Tue Aug 07, 2007 4:02 pm

image display problem

Post by itsmeranu »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


i'm new to GD. i've installed & configured gd 2.1.9 successfully with PHP5. i'm working on IIS5 on windows XP.

i get a simple problem when i run any program containing php-gd functions. eg.

Code: Select all

<?php

$imagepath="img.jpg";

$image=imagecreatefromjpeg($imagepath);

header('Content-Type: image/jpeg');

imagejpeg($image);

?>

the output in the browser doesn't show the image. instead it displays the url of the php file. ie on my system: http://localhost/ranuphp/GD/showimg.php

[s]whts[/s] what's wrong? [s]cn[/s] can anybody help [s]plz[/s] please..


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

[quote="[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1"][b]11.[/b] Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.

Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.[/quote]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I'm not sure of the reason to use the image functions if you're not going to manipulate the image.. readfile() would be better.
Post Reply