posting troubles
Posted: Wed Oct 13, 2010 3:14 pm
Code: Select all
Can anyone help me figure out why the $percent variable isn't posting
<?php
$postIt = $_SERVER["PHP_SELF"];
$display_block .="
<b>Choose a department to review:</b>
<form action=\"$postIt\" >
<select name=\"area\" onchange=\"this.form.submit();\">
<option>Behm</option>
<option>BronchLab</option>
<option>C/SParkPlace</option>
</select>
</form>
";
$areaSelected = $_POST['area'];
$conn = doDB();
$sql = "Select percent1 FROM data WHERE Area = '{$areaSelected}'";
$result = mysql_query($sql,$conn) or die(mysql_error());
while ($newArray = mysql_fetch_array($result))
{
$percent = $newArray['percent1'];
}
$display_block .="
the percent is $percent
";
echo $areaSelected;//nothing happens here?!?
<html>
<head>
<meta http-equiv="pragma" content="no-cache"/>
<title>KDMC - Quality Manager Admin Online</title>
<link href="ostyle.css" rel="stylesheet" type="text/css">
</head>
<body>
<?php echo $display_block; ?>
</body>
</html>
?>
but it doesnot allow me to even echo it...what the heck?