Hello! I am making a web app/program using html, css and php. I know basics in html, css and php, but still dont know much, especialy in php. The program i am making keeps score for a game, so the website opens, you enter how many points where earned, and the program tells you what the current score is. I have everything worked out, exept when you re-enter the next amount of points earned, it doesnt add it to the old, it just displays the new amount. HOW DO I KEEP A RUNNING TOTAL?? Below Is The PHP Code Used… And A Link To The Website Where It Is Hosted.
PHP CODE-
<?php
$bonus= $_POST['bonus'];
$buzz= 10;
$total= $bonus + $buzz;
$runningtotal= $total + $runningtotal;
echo "points gotten this round: $total points total: $runningtotal ";
?>
LINK-
www.allthingsjacob.com/bb/index1.html
the link brings you to the html, after entering first number it forwards you to the php code (allthingsjacob.com/bb/work.php) which procceses the code, then after the php closing tag (?>) the same html code is run. below is every single line of code on the work.php page-
<?php
$bonus= $_POST['bonus'];
$buzz= 10;
$total= $bonus + $buzz;
$runningtotal= $total + $runningtotal;
echo "points gotten this round: $total points total: $runningtotal ";
?>
<some tags not here so that this website shows the code and not the final product.>
<head f>
<titled>BBS</title>
</head>
<Taken so you can see the code>
<h1>
Bible Bowl Score-Keeper Web Application Designed By Jacob H
</h1>
<p>
Version 0.0
</p>
<h3>
Select Amount Of Gotten Bonus Points. The App Will Do The Rest.
</h3>
<form action="work.php" method="post" value="bbs" name="bonuspoints">
<!-- Below Is Radio Buttons For The Selection Of Bonus Points Gotten. PHP work.php Adds 10. -->
<input type="text" name="bonus">
<input type="submit">
</form>
<Taken so you can see the code>
<Taken so you can see the code>
Thanks For Your Help!!