I'm having trouble passing arguments from html into a php script that I'm using to generate a simple line graph. I'm attempting to use the $_GET method to retrieve the variables.
Here's my html code;
<td><img src="include/drawLinearChart.php?slope='.$xver.'&yInt='.$yver.'&chartName='.$scaleName.'" width="350" height="300" /></td>
And the piece of code in drawLinearChart.php that applies the incoming variables to local variables. I know I don't need to do that and can just use them wherever, but from a troubleshooting perspective I've just been trying to ensure that they get there.
$varSlope = $_GET["slope"];
$varY_Intercept = $_GET["yInt"];
$varScaleName = &_GET["chartName"];
Any help would be appreciated. Thanks.
All,
I found the solution. The html side of things needs to look like this;
<td><img src='include/drawLinearChart.php
?slope=<?php echo urlencode($xver); ?>
&yInt=<?php echo urlencode($yver); ?>
&chartName=<?php echo urlencode($scaleName); ?>'
width="350" height="300"/>
</td>
This properly encapsulates everything on the html side and packages it into URI-safe encoding. The output from my Apache log is now this;
"GET /projects/WebUI/include/drawLinearChart.php?slope=1&yInt=3&chartName=0-50PSIG HTTP/1.1" 200 14037
Thanks guys for the above syntax corrections.
-Ian