Course Solutions Uncategorized (Solved) : Add Timer Keep Track Correct Incorrect Stats Cookies Session Data Code Adderphp Math Adder Q32083514 . . . .

(Solved) : Add Timer Keep Track Correct Incorrect Stats Cookies Session Data Code Adderphp Math Adder Q32083514 . . . .

 

Add a timer, and keep track of correct/incorrect stats withcookies or session data. Below is the code

Adder.php

<html>

<head>

<title>Math Adder</title>

</head>

<body>

<h3> Addition Quizer </h3>

<form action=”Adder2.php” method=”get”>

<?php
$n1 = rand(0,9);

$n2 = rand(0,9);
?>

<?php echo ($n1) ?> + <?php echo ($n2) ?> =

<input type “text” name=”answer” size=”3″>

<input type=”hidden” name=”n1″ value= “<?php echo ($n1);?>” >

<input type=”hidden” name=”n2″ value= “<?php echo ($n2);?>” >
<br></br>
<input type=”submit” value=”Is that Right?” />

</form>

</body>

</html>

____________________________________

Adder2.php

_______________________________

<html>

<head>

<title>Math Adder 2</title>

</head>

<body>

<h3> Addition Quizer </h3>

<?php
if(isset($_GET[‘n1’])){
$n1 = (int)$_GET[‘n1’];
$n2 = (int)$_GET[‘n2’];
$answer = (int)$_GET[‘answer’];

if($answer == $n1+$n2){
echo $n1 .” + “.$n2.” = “.$answer.” ! It is a correct answer”;
}

else{
echo $n1 .” + “.$n2.” = “.$answer.” ???… Sorry the answer is”.($n1+$n2);

}
}

?>
<h3> Okay, try again… </h3>

<form action=”Adder2.php”

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Answered) : Q2 7 Marks Grinding Process Value Roughness Measured Mm Use Data Table Answer Following Qu Q36309154(Answered) : Q2 7 Marks Grinding Process Value Roughness Measured Mm Use Data Table Answer Following Qu Q36309154

<br/><img src="https://media.cheggcdn.com/media%2F494%2F494d12af-1dcf-4aee-b487-bdac475a4832%2Fimage.png" alt="Q2(7 marks) In a grinding process, the value for roughness was measured in (mm).Use the data in the table below to answer the" aria-describedby="j1t"/>Q2(7 marks) In a grinding