Need Immediate help for PHP assignment

Looking for volunteers to join your project? Need help with a script but can't afford to pay? Want to offer your services as a volunteer to build up your portfolio? This is the place for you...

Moderator: General Moderators

Post Reply
arjumand
Forum Newbie
Posts: 6
Joined: Wed Oct 17, 2007 1:48 am

Need Immediate help for PHP assignment

Post by arjumand »

***** Please use a descriptive title and include specifics in your question. *****
***** Double posting is against forum rules *****

I am a newbie in PHP programming. I have been given an assignment by my teacher and that is to make lone drawings thru php code.I am using Easyphp 1.8 and I need help on as to how this should be done.
User avatar
Josh1billion
Forum Contributor
Posts: 316
Joined: Tue Sep 11, 2007 3:25 pm

Post by Josh1billion »

"lone drawings"??

You mean you want to generate images? If so, you will need to first make sure you have the GD library/extension installed/enabled, then have a look at http://www.phpgd.com for some tutorials.
arjumand
Forum Newbie
Posts: 6
Joined: Wed Oct 17, 2007 1:48 am

Post by arjumand »

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]


Yes I mean image generation.............I am trying the following code but its not working.What should I do

Code: Select all

<?php
//draw1.php
Header("Content-type: image/jpeg");
$image = ImageCreate(200,150);
$gray = ImageColorAllocate($image,204,204,204);
$blue = ImageColorAllocate($image,0,0,255);
ImageLine($image,10,10,150,30,$blue);
ImageJPEG($image);
ImageDestroy($image);
?>
Furthermore how should I enable the GD library.


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]
User avatar
Josh1billion
Forum Contributor
Posts: 316
Joined: Tue Sep 11, 2007 3:25 pm

Post by Josh1billion »

You should put php tags around your code to make it easier to read, like this but without the dashes: [p-h-p] code here [/p-h-p]
Furthermore how should I enable the GD library.
Your host will have to enable this, but most hosts do already have it enabled so you shouldn't have much to worry about. But if your page says "Fatal error: undefined function ImageCreate()", that means it's not enabled.
Yes I mean image generation.............I am trying the following code but its not working.What should I do
What's the problem? I tested it out right here and it worked fine. Like I said above, if it says that the ImageCreate() function is not defined, that means the GD library isn't enabled, so you'll have to enable that. If that's not the error message you're getting, then you'll have to post the error message you are getting so that we know what the problem is. :)
Post Reply