Current location: Hot Scripts Forums » Programming Languages » PHP » Help with graphs


Help with graphs

Reply
  #1 (permalink)  
Old 04-30-04, 07:53 AM
bigdave bigdave is offline
Newbie Coder
 
Join Date: Apr 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Help with graphs

Hi All,

I've got a php script which outputs a pie chart, now the trouble is I would like to output the image into an html page but whenever I do I get an error message about headers.

I'm using the script from Geek247's site, if that helps!

Hope someone can help.

Regards

Big Dave
Reply With Quote
  #2 (permalink)  
Old 04-30-04, 08:29 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
I assume that the php script is only used to output the graph, so just use the normal img tag in html
Code:
<img src="graph.php" alt="Graph" />
hopefully this will work..
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
  #3 (permalink)  
Old 05-01-04, 09:19 AM
bigdave bigdave is offline
Newbie Coder
 
Join Date: Apr 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
I've tried that and all i'm getting is a red ex (as in missing graphic file)!

Any more ideas?
Reply With Quote
  #4 (permalink)  
Old 05-01-04, 09:50 AM
Bonzo's Avatar
Bonzo Bonzo is offline
Coding Addict
 
Join Date: Jan 2004
Posts: 340
Thanks: 0
Thanked 0 Times in 0 Posts
Try replacing "graph.php" with the name of the script page or show the relavent part of the code here.

Anthony

P.S. This is assuming you are not saving the graph.
Reply With Quote
  #5 (permalink)  
Old 05-04-04, 05:28 AM
bigdave bigdave is offline
Newbie Coder
 
Join Date: Apr 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Hi,

The last part of teh code that outputs the image is:

// output to browser
Header("Content-Type: image/png");
ImagePNG($im);


But I would like it to output to the folder its in so the html page could display it.

If I insert all the php code into an html page I get a header error.

Any ideas?

Dave
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Graphs Apoc PHP 4 04-17-04 03:18 AM


All times are GMT -5. The time now is 10:31 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.