Addin and multiplying help<

liunx

Guest
For practice and for making my homework easier I am trying to make a statistics calculator. Its supposed to show mean, Variance, and Standard Deviation. I am stuck on the easy part, mean.
<!-- m --><a class="postlink" href="http://www.ramptstudios.com/php/data.html">http://www.ramptstudios.com/php/data.html</a><!-- m -->
Enter data then submit it. You'll see my error. Here is my code as of now:

<html>
<head>
<title>Your answers</title>
</head>
<body>
<center>
Mean= <?php echo (($_POST[data1]*$_POST[1freq])+($_POST[data2]*$_POST[2freq])+($_POST[data3]*$_POST[3freq])+($_POST[data4]*$_POST[4freq]))/$_POST[points]); ?>
<br>
</center>
</body>
</html>

Just view the sources of the data entering page if you think that's the problem but I dont see it could be.Mean= <?php echo (($_POST[data1] * $_POST[1freq]) + ($_POST[data2] * $_POST[2freq])+ ($_POST[data3] * $_POST[3freq]) + ($_POST[data4] * $_POST[4freq])) / $_POST[points]; ?>

you had a extra ) in thereParse error: parse error, expecting `']'' in /home/guitarhero/domains/ramptstudios.com/public_html/php/view.php on line 7you can't start your names with numbers.

1freq

shoudl be changed to

freq1 and same with the others.YES it works. Thanks for the help. Im sure Ill be needed more help later on with this.
 
Back
Top