How drawing using PHP?

Need help with Photoshop, the GIMP, Illustrator, or others? Want to show off your work? Looking for advice on your newest Flash stuff?

Moderator: General Moderators

Post Reply
Darginec
Forum Newbie
Posts: 1
Joined: Wed Nov 13, 2002 1:57 am
Contact:

How drawing using PHP?

Post by Darginec »

Help!
Please, if know write how drawing the diagram?
:wink:
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

what diagram?
here's a small example (of something ;) )

Code: Select all

<?php
$y1 = (isset($_GETї'startY']))?$_GETї'startY'] : 50;
$y2 = (isset($_GETї'endY']))?$_GETї'endY'] : 50;

$img = imagecreate(100,100);

$color = imagecolorallocate ($img, 200, 200, 200);
imagerectangle($img, 0,0,99,99, $color);

$color = imagecolorallocate ($img, 255, 0, 0);
imageline($img, 0, $y1, 99, $y2, $color);

header('Content-type: image/png');
imagepng($img);
?>
have a look at http://www.php.net/manual/en/ref.image.php
User avatar
Heavy
Forum Contributor
Posts: 478
Joined: Sun Sep 22, 2002 7:36 am
Location: Viksjöfors, Hälsingland, Sweden
Contact:

Post by Heavy »

volka wrote:

Code: Select all

<?php
$y1 = (isset($_GETї'startY']))?$_GETї'startY'] : 50;
$y2 = (isset($_GETї'endY']))?$_GETї'endY'] : 50;
?>
What does "?" and ":" mean?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

heavy -

Code: Select all

$y1 = (isset($_GETї'startY']))?$_GETї'startY'] : 50;
This would equate to:

Code: Select all

if (isset($_GETї'startY'])) {
   $y1 = $_GETї'startY'];
} else {
   $y1 = 50;
}
Mac
Jeph
Forum Newbie
Posts: 1
Joined: Thu Jul 22, 2004 6:07 am
Location: Aveiro

Post by Jeph »

User avatar
JayBird
Admin
Posts: 4522
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Why reply to a topic that is nearly 2 years old :)

You had me thinking Twig was back
Post Reply