Re: clearing cache ...... still not workin out

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I think the problem is in the code mentioned below.

<table width='100%' border='0'>
<tr><td> </td></tr>
<tr><td> </td></tr>
<tr> <td align='center'>
<img src=abc.jpg>
</td> </tr>
</table>
");

You are creating a file abc.jpg, then showing it to
the client via the link. You are not sending any
headers regarding this jpg file. 

Try this way - create graph generating php file:

graph.php file:
**************************************************
<?php
Header("Content-type: image/jpeg");
Header("Expires: Fri, 10 Jun 1976 07:00:00 GMT");

$pth = "abc.jpg";
$im = imagecreatefromjpeg($pth);

// some operations with your image - create your graph

Imagejpeg($im); // send to the client
ImageDestroy($im); // free resources
?>
**************************************************

then in your html try to place such generated image:

<IMG SRC='graph.php?if needed - your parameters'
WIDTH='width' HEIGHT='height' BORDER='0'>

Headers will be sent and your graph will be reloaded.

It's based on a real world :-) working program i wrote
long ago. I've changed only type gif to your jpeg...
so check exactly functions names.

HTH, let me know
Piotr


--- toby z <blue_myth_1@yahoo.com> wrote:
> heres my code pitor 
> for generate_graph.php
> 
> this file is included in all query files ...... 
> 
> 
> =======================
> 
> 
> // ma data 
> 
> $max_data = count($gfData);
> 
> for ($k = 0; $k < $max_data; $k++)
> {
> 	//$arrData[$k] = $gfData[$k] * $factor ;
> 	$data[$k] = $gfData[$k]  ;
> }
> 
> 
> 
> 
> // Create the Pie Graph.
> $graph = new PieGraph(650,400,"auto");
> $graph->SetShadow();
> 
> 
> //split title :P:P:P  ! ! ! !
> 
> $newStr=""; 
> 
> $newStr = explode( "/r/n", $title );
> 
> $graph->title->Set("$newStr[0]");
> $graph->subtitle->Set("$newStr[1]");
> $graph->title->SetFont(FF_VERDANA,FS_BOLD,18); 
> $graph->title->SetColor("darkblue");
> $graph->legend->Pos(0.1,0.2);
> 
> // Create 3D pie plot
> $p1 = new PiePlot3d($data);
> $p1->SetTheme("sand");
> $p1->SetCenter(0.4);
> $p1->SetSize(150);
> 
> // Adjust projection angle
> $p1->SetAngle(45);
> 
> // Adjsut angle for first slice
> $p1->SetStartAngle(45);
> 
> // Display the slice values
> $p1->value->SetFont(FF_ARIAL,FS_BOLD,11);
> $p1->value->SetColor("navy");
> 
> // Add colored edges to the 3D pie
> // NOTE: You can't have exploded slices with edges!
> $p1->SetEdge("navy");
> 
> 
> for ($i = 0; $i < $max_data; $i++)
> {
> 	if ($arrData[$i] > $max_value)
> 		$max_value = $arrData[$i];
> 
> 	if ( strlen($label[$i]) > $max_label_width )
> 		$max_label_width = strlen($label[$i]);
> 
> $p1->SetLegends($label);
> 
> $ttl_rkrdz = array_sum($gfData);
> }
> 
> 
> $graph->Add($p1);
> $graph->Stroke("abc.jpg");
> 	
> 	echo("
> 			<table width='100%' border='0'>
> 			
> 				<tr><td> </td></tr>
> 				<tr><td> </td></tr>
> 				<tr> <td align='center'>
> 					<img src=abc.jpg>
> 				</td> </tr>
> 			</table>
> 			
> 			<br><br><br>
> 	");
> 	
> 
> 
> $table_text = "<table align='center'
> border='0'><tr><td
> align='center'> </td></tr>
> 				
> 				<tr><td align='center'></td></tr><tr><td
> align=center ><br><table
> border=4><tr>";
> 
> 
> 
> for ($i = 0; $i < $max_data; $i++)
> {
> 	if ($arrData[$i] > $max_value)
> 		$max_value = $arrData[$i];
> 
> 	if ( strlen($label[$i]) > $max_label_width )
> 		$max_label_width = strlen($label[$i]);
> 
> 	$table_text = $table_text . "<th> " . $label[$i] .
> " </th>";
> 	$ttl_rkrdz = array_sum($gfData);
> 
> }
> $table_text = $table_text . "</tr>";
> $table_text = $table_text . "<tr>";
> 
> 
> for ($i = 0; $i < $max_data; $i++)
> {
> 
> 	$table_text = $table_text . "<td style=
> \"font-family: $font\" >" .
> $gfData[$i] . "</td>";
> 	
> 	
> }
> $table_text = $table_text . "</tr>
> 		</table></td></tr>
> 		<tr>
> 			<td style= \"font-family: $font\"> </td> 
> 		</tr>
> 				<tr><td> </td></tr>
> 				
> 		<tr> <td>
> 		<table border='4' align=center> 
> 		<tr>
> 			<th width='50%' valign='center' style=
> \"font-family: $font\">
> Total Records  </th>
> 			<td width='50%' valign='center' style=
> \"font-family: $font\">
> $ttl_rkrdz </td> 
> 		</tr>
> 		</table>
> 		</td>
> 		</tr>
> 		<tr><td> </td></tr>
> 		<tr><td> </td></tr>
> 		<tr><td> </td></tr>				
> 		";
> 		
> echo($table_text);
> 
> 
> =========================================
> 
> 
> thnx a mill again
> 
> toby
> 
> 
> --- Piotr Pluciennik <ppluciennik@yahoo.com> wrote:
> > How do you send
> this file generated graph to the
> > client browser? 
> > Are you using one of the functions ImagePNG(),
> > ImageWBMP(), ImageJPEG() 
> > or 
> > are you presenting a link to your graph in php
> > generated html output? 
> > 
> > Piotr
> > 
> > --- toby z <blue_myth_1@yahoo.com> wrote:
> > > thnx guyz
> > > 
> > > but i have tried 
> > > 
> > > header("Expires: Mon, 26 Jul 1997 05:00:00
> GMT");   
> > > // Date in the
> > > past
> > > header("Last-Modified: " . gmdate("D, d M Y
> H:i:s")
> > > . " GMT");   //
> > > always modified
> > > header("Cache-Control: no-store, no-cache,
> > > must-revalidate");  //
> > > HTTP/1.1
> > > header("Cache-Control: post-check=0,
> pre-check=0",
> > > false);
> > > header("Pragma: no-cache");                     
>   
> > > // HTTP/1.0
> > > 
> > > 
> > > and it aint working either .....
> 
=== message truncated ===


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux