Hi, I'm hoping someone can help me with this problem:
I'm trying to get two option values to post in the code and call up an xml file that will display a chart. I'm going to post two different pages of code. Here's the first code, with the post and the options:
<div class="story">
<h3> </h3>
<h3 align="center" class="style3"> </h3>
<form action='calculator_results.php' method='post'>
<table style='margin-left:auto;margin-right:auto' cellpadding='10'>
<tr>
<td colspan="2"><h3><span class="style3">Please make the following choices to calculate your savings:</span></h3></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td width="190">Electricity Provider</td>
<td width="288">
<select name='utility'>
<option value='1' selected="selected">PECO Energy Company</option>
<option value='2'>Allegheny Power</option>
<option value='3'>Jersey Central Power & Light</option>
<option value='4'>Progress Energy</option>
</select> </td>
</tr>
<tr>
<td>Square Footage of Home</td>
<td>
<select name='sf'>
<option value='a'>1000-1500</option>
<option value='b'>1500-2000</option>
<option value='c'>2000-2500</option>
<option value='d'>2500-3000</option>
<option value='e'>3000-3500</option>
<option value='f'>3500-4000</option>
</select> </td>
</tr>
<tr>
<td height="73" style='text-align:center'> </td>
<td height="73" style='text-align:left'><input name="submit" type='submit' value='Calculate Savings'/></td>
</tr></table>
Here's the second code. I'm sure this is incorrect, but I'm very green with PHP and haven't been able to figure out the fix.
<div class="feature">
<p><script language="javascript">AC_FL_RunContent = 0;</script>
<script language="javascript"> DetectFlashVer = 0; </script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
var requiredMajorVersion = 9;
var requiredMinorVersion = 0;
var requiredRevision = 45;
-->
</script>
<?php
$utility = $_POST['utility'];
$sf = $_POST['sf'];
?>
<script language="JavaScript" type="text/javascript">
<!--
if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if(hasRightVersion) {
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0',
'width', '500',
'height', '300',
'scale', 'noscale',
'salign', 'TL',
'bgcolor', '#ffffff',
'wmode', 'opaque',
'movie', 'charts',
'src', 'charts',
'FlashVars', 'library_path=charts_library&xml_source=<?php $_GET[$utility,$sf]?>.xml',
'id', 'my_chart',
'name', 'my_chart',
'menu', 'true',
'allowFullScreen', 'true',
'allowScriptAccess','sameDomain',
'quality', 'high',
'align', 'middle',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'play', 'true',
'devicefont', 'false'
);
} else {
var alternateContent = 'This content requires the Adobe Flash Player. '
+ '<u><a href=http://www.macromedia.com/go/getflash/>Get Flash</a></u>.';
document.write(alternateContent);
}
}
// -->
</script></p>
</div>
I'm trying to call an xml chart based on the selections from the first code (i.e. 1a.xml, 2b.xml, 3f.xml, etc...).
Can anyone help with this? I would sincerely appreciate any help...I don't have much hair left to pull out. 🙂