Ver Mensaje Individual
  #5 (permalink)  
Antiguo 02/03/2009, 18:08
0le0
 
Fecha de Ingreso: octubre-2008
Mensajes: 109
Antigüedad: 16 años, 3 meses
Puntos: 0
Respuesta: Jpgraph y paso de variables en imagen

Sigue sin funcionar...
TEngo esto:

Esta página llama a 88888 y ahí es donde llamo a la imagen...
Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin t&iacute;tulo</title>
</head>

<body>

<form action="88888.php">
<select name="estado" >
<option value="01">aguascalientes</option>
</select>
<input type="submit" />
</form>
</body>

</html>
ESte es el archivo 88888
Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin t&iacute;tulo</title>
</head>

<body>
<? if(isset($_GET['estado'])) 
$est= $_GET['estado'];
?>

<div align="center">
<img src="bar2scalesex1.php?estado=<? echo $est; ?>" />
</div>
</body>
</html>
Y este archivo barscalesex1.php, es el que me genera la grafica de acuerdo al estado enviado pero no recibo tal valor

Código:
<?php
if(isset($_GET['estado'])) 
$est= $_GET['estado'];
echo "estado:".$est;
include ("jpgraph/jpgraph.php");
include ("jpgraph/jpgraph_bar.php");

$dbhost="t";  // host del MySQL (generalmente localhost)
$dbusuario="t"; // aqui debes ingresar el nombre de usuario
                      // para acceder a la base
$dbpassword="t"; // password de acceso para el usuario de la
                      // linea anterior
$db="alianza";        // Seleccionamos la base con la cual trabajar
$conexion = mysql_connect($dbhost, $dbusuario, $dbpassword);
mysql_select_db($db, $conexion);



$consulta="select m from inm_domicilio where m=1";
$result2=mysql_query($consulta, $conexion);
$row2 = mysql_fetch_row($result2);
$tpm = $row2[0];
mysql_free_result($result2);

$consulta2="select c from inm_domicilio where c=1";
$result2=mysql_query($consulta2, $conexion);
$row2 = mysql_fetch_row($result2);
$tpc = $row2[0];
mysql_free_result($result2);	

$consulta3="select i from inm_domicilio where i=1";
$result2=mysql_query($consulta3, $conexion);
$row2 = mysql_fetch_row($result2);
$tpi = $row2[0];
mysql_free_result($result2);


$datay=array(($tpm/1000000),($tpc/1000000),($tpi/1000000));
$datay2=array(700,930,1000);
$datazero=array(0,0,0);

// Create the graph. 

$graph = new Graph(600,400);
$graph->title->Set('Presupuesto Por Programa (mdp)');

// Setup Y and Y2 scales with some "grace"	
$graph->SetScale("textlin");
$graph->SetY2Scale("lin");
$graph->yaxis->scale->SetGrace(50);
$graph->y2axis->scale->SetGrace(50);
$graph->yaxis->title->Set("hola");

//$graph->ygrid->Show(true,true);
$graph->ygrid->SetColor('gray','[email protected]');

// Setup graph colors
$graph->SetMarginColor('white');
$graph->y2axis->SetColor('darkred');


// Create the "dummy" 0 bplot
$bplotzero = new BarPlot($datazero);

// Create the "Y" axis group
$ybplot1 = new BarPlot($datay);
$ybplot1->value->Show();
$ybplot = new GroupBarPlot(array($ybplot1,$bplotzero));

// Create the "Y2" axis group
$ybplot2 = new BarPlot($datay2);
$ybplot2->value->Show();
$ybplot2->value->SetColor('darkred');
$ybplot2->SetFillColor('darkred');
$y2bplot = new GroupBarPlot(array($bplotzero,$ybplot2));

// Add the grouped bar plots to the graph
$graph->Add($ybplot);
$graph->AddY2($y2bplot);

// .. and finally stroke the image back to browser
$graph->Stroke();
?>
Como sería?
Ya busque si se puede obtener la variable desde una imagen y nada.... :(