I'm new to PHP and have been trying to teach myself. However, I'm stumped. What I'm doing is creating an online worksheet that would perform mathematical functions based on the data that a person inputs. To do this, I would need two files.
No error messages appear currently, but I'm missing some data. All of the $player1, $player2, etc. show up, but not the $sum, $sum2, etc.
The first file is currently:
<?php
if($action=="calculate")
$sum=($totalfg$player1fg)+($totalft$player1ft)+($total3$player13)+($totalpts$player1pts)+($totalrebs$player1rebs)+($totalasts$player1asts)+($totalstls$player1stls)+($totalblks$player1blks); // calculate
?>
<?php
if($action=="calculate")
$sum2=($totalfg$player2fg)+($totalft$player2ft)+($total3$player23)+($totalpts$player2pts)+($totalrebs$player2rebs)+($totalasts$player2asts)+($totalstls$player2stls)+($totalblks$player2blks); // calculate
?>
<?php
if($action=="calculate")
$sum3=($totalfg$player3fg)+($totalft$player3ft)+($total3$player33)+($totalpts$player3pts)+($totalrebs$player3rebs)+($totalasts$player3asts)+($totalstls$player3stls)+($totalblks$player3blks); // calculate
?>
<?php
if($action=="calculate")
$sum4=($totalfg$player4fg)+($totalft$player4ft)+($total3$player43)+($totalpts$player4pts)+($totalrebs$player4rebs)+($totalasts$player4asts)+($totalstls$player4stls)+($totalblks$player4blks); // calculate
?>
<form name="form1" method="post" action="warroomwsresults.php">
<input type="submit" name="Submit" value="Submit">
<input type="hidden" name="action" value="calculate">
And my second file within a table looks like this:
<?php
echo "$player1";
?>
<?php
echo "$sum";
?> <?php
echo "$player2";
?>
<?php
echo "$sum2";
?>
<?php
echo "$player3";
?>
<?php
echo "$sum3";
?>
<?php
echo "$player4";
?>
<?php
echo "$sum4";
?>
If you want to see exactly what it currently looks like, go here...
http://www.rotomojo.com/warroomws.php
After data is input there, it goes to...
http://www.rotomojo.com/warroomresults.php
Thanks!