LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-20-2005, 02:28 AM   #1
pranith
Member
 
Registered: Sep 2004
Location: Hyd,India
Posts: 83

Rep: Reputation: 15
drawing line in php on web page


hi...

can we draw a line on web page using php or some other languages...

thanks....



bye,
Pranith
 
Old 06-20-2005, 03:07 AM   #2
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
The perfect solution would be a SVG object inside an XHTML document, but I don't know what is the current status of SVG support.
Else PHP has support for generating images, and I seem to remember there's a pseudo-protocol named 'data:' for embedding the graphics inside the markup.

Yves.
 
Old 06-21-2005, 01:01 AM   #3
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Quote:
can we draw a line on web page using php
Sure...
PHP Code:
<?php echo '<hr />'?>
 
Old 06-21-2005, 02:13 AM   #4
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66


That's so true! But only for horizontal lines, though.

Yves.
 
Old 06-21-2005, 03:40 AM   #5
pranith
Member
 
Registered: Sep 2004
Location: Hyd,India
Posts: 83

Original Poster
Rep: Reputation: 15
hi,
let me make it more clear.We have two points and we have to draw a line segment between them
thanks
bye
pranith
 
Old 06-21-2005, 03:49 AM   #6
r0b0
Member
 
Registered: Aug 2004
Location: Europe
Posts: 608

Rep: Reputation: 50
Huhl?
I'm sorry but either I missunderstand your question or you have absolutely zero knowledge about web, html and php.
How are the two points specified and what kind of "line" do you have to "draw"?
I suggest you read at least the first chapter of any book on web and html.
 
Old 06-21-2005, 04:14 AM   #7
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
PHP Code:
<?php
header
("Content-type: image/png");

$im = @imagecreate(100100)
   or die(
"Cannot Initialize new GD image stream");
$background_color imagecolorallocate($im
                                
255255255 //white
                                
);

$black imagecolorallocate($im000);
imageline($im,
        
55// first point coordinates
        
80,80// last point coordinates
        
$black);

imagepng($im);
imagedestroy($im);
?>
(requires that php is compiled with gd)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant make web server run my local web page... Nik0s Linux - Newbie 22 10-08-2006 10:30 PM
updating a line of text on a php web server mrobertson Programming 9 06-15-2005 09:43 AM
Setting a web page with php! mithras Linux - General 14 07-25-2003 03:25 PM
Jerky mouse when web browsers download web page stodge Linux - Software 1 07-08-2003 10:29 PM
Drawing a line chr15t0 Linux - General 1 03-27-2003 03:36 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration