Hi;
I am having a crappy day. The internet is slow, I had to move my work computer off-site because of an asbestos discovery and am having all kinds of fun and games trying to get VPN & proxy & blah blah security stuff set up so I can work off-site and etc. etc. etc. Thanks for letting me vent.
Anyway...
Here is the deal. I want to use JpGraph to generate a bunch of images (ie CanvasGraphs) based on variable inputs (ie I feed in the string "columnname" and it creates an image of the word "columnname". That's not the problem...that part all works fine.
But what I DON'T understand is how to get the image that is generated saved as a static image file in some directory on the server. I have been looking at functions like imagejpeg() etc all morning and I just don't get how to use these.
So here are the files I have so far:
v_headertest.jpg (this cycles through an array of possible column names and creates the aforementioned images)
<html>
<head>
<?php include("../../../_style1.css"); ?>
</style>
</head>
<body>
<table>
<tr>
<?php
$colheads=array('FALL','WINTER','SPRING');
foreach($colheads as $key=>$value)
{echo "<th><img src=\"v_header.php?colhead=$value\"></td>";}
?>
</tr>
</table>
</body></html>
v_header.php is the jpgraph script that does the magic (creates the image and plops it into the table cells in the prior file)
<?php
$colhead=$_GET['colhead'];
include ("../jpgraph.php");
include ("../jpgraph_canvas.php");
$graph = new CanvasGraph(30,100);
$t1 = new Text("$colhead");
$t1->SetAngle(90);
$t1->SetFont(FF_ARIAL,FS_BOLD,12);
$t1->SetBox("navy","navy","navy",0,0);
$t1->SetColor("silver");
$graph->AddText($t1);
$graph->Stroke();
?>
All this works fine...but how do I save the output images as files on the server? Say as v_head_FALL.jpg, v_head_WINTER.jpg, v_head_SPRING.jpg, etc.) (That way I can just use these static images when needed rather than having to run the script a gazillion times a day on a busy server?
WHY do I want to do this? I do a lot of stuff with data tables and want to have a method of having vertical column labels that will work in BOTH IE and Mozilla/Firefox browsers. Theoretically, creating the column names as images seems like it would work. I know how to do the css vertical-text trick, but can't find anything that simple for Firefox.