PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Thu Dec 13, 2018 7:13 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: How drawing using PHP?
PostPosted: Wed Nov 13, 2002 2:57 am 
Offline
Forum Newbie

Joined: Wed Nov 13, 2002 2:57 am
Posts: 1
Help!
Please, if know write how drawing the diagram?
:wink:


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 13, 2002 3:18 am 
Offline
DevNet Evangelist
User avatar

Joined: Tue May 07, 2002 9:48 am
Posts: 8391
Location: Berlin, ger
what diagram?
here's a small example (of something ;) )
Syntax: [ Download ] [ Hide ]
<?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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 13, 2002 6:59 am 
Offline
Forum Contributor
User avatar

Joined: Sun Sep 22, 2002 7:36 am
Posts: 478
Location: Viksjöfors, Hälsingland, Sweden
volka wrote:
Syntax: [ Download ] [ Hide ]
<?php
$y1 = (isset($_GETї'startY']))?$_GETї'startY'] : 50;
$y2 = (isset($_GETї'endY']))?$_GETї'endY'] : 50;
?>

What does "?" and ":" mean?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 13, 2002 7:13 am 
Offline
Her Royal Site Adminness
User avatar

Joined: Tue Apr 23, 2002 2:21 am
Posts: 5371
Location: Essex, UK
heavy -
Syntax: [ Download ] [ Hide ]
$y1 = (isset($_GETї'startY']))?$_GETї'startY'] : 50;

This would equate to:
Syntax: [ Download ] [ Hide ]
if (isset($_GETї'startY'])) {

   $y1 = $_GETї'startY'];

} else {

   $y1 = 50;

}

Mac


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 22, 2004 6:07 am 
Offline
Forum Newbie

Joined: Thu Jul 22, 2004 6:07 am
Posts: 1
Location: Aveiro
I suggest you download my class ;)

http://www.phpclasses.org/browse/package/1600.html


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 22, 2004 6:16 am 
Offline
Admin
User avatar

Joined: Wed Aug 13, 2003 7:02 am
Posts: 4522
Location: York, UK
Why reply to a topic that is nearly 2 years old :)

You had me thinking Twig was back


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group