Count Status

Database open failed

"; echo ""; exit; } // Read the values we're intrested in. $tot = dba_fetch("total", $db); $cnt = dba_fetch("cnt", $db); // Update the values. $tot += $_REQUEST["amt"]; $cnt = $cnt + 1; // Save them back to the database. dba_replace("total", "$tot", $db); dba_replace("cnt", "$cnt", $db); // The system will close automatically at the end of the script, // but since we're done with it now it's better to say so. This // allows other threads to use the file if they need to. dba_close($db); // Display. $av = $tot/$cnt; echo << This page has counted $cnt submissions for a total of $tot. The average submission is $av.

END; // If present, provide a return link. if($_SERVER["HTTP_REFERER"]) { echo '

Return to Form

'; } ?>