I have a .php page that calls itself via a form multiple times. The user has 9 input choices that are represented by images. Let's say the .php file is called quiz.php:
<?php
...blah blah php session start variable stuff
$client_answer = $_POST['input_from_test_1'] ;
$true_answer = $_SESSION["1-2-2_true_answer"];
if($client_answer == $true_answer)
{
$feedbackJudgement=1;
}
else
{
$feedbackJudgement=0;
}
$randomHandType = rand(1,13);
if ($randomHandType >= 10)
{
$randomHandType = 1;
}
$true_answer = $randomHandType;
print"
<form method='post' action='quiz.php'>";
//the following three rows are the 9 feedback buttons the client
// has available to him. A keypad of hand types.
//row 1
print"
<div style='position: absolute; left: 400px; top: 440px;'>
<input type='image' value='1' name='input_from_test_1' src='1_button.png'>
</div>
<div style='position: absolute; left: 565px; top: 440px;'>
<input type='image' value='2' name='input_from_test_1' src='2_button.png'>
</div>
<div style='position: absolute; left: 730px; top: 440px;'>
<input type='image' value='3' name='input_from_test_1' src='3_button.png'>
</div>
";
//row 2
print "
<div style='position: absolute; left: 400px; top: 520px;'>
<input type='image' value='4' name='input_from_test_1' src='4_button.png'>
</div>
<div style='position: absolute; left: 565px; top: 520px;'>
<input type='image' value='5' name='input_from_test_1' src='5_button.png'>
</div>
<div style='position: absolute; left: 730px; top: 520px;'>
<input type='image' value='6' name='input_from_test_1' src='6_button.png'>
</div>
";
//row 3
print "
<div style='position: absolute; left: 400px; top: 600px;'>
<input type='image' value='7' name='input_from_test_1' src='7_button.png'>
</div>
<div style='position: absolute; left: 565px; top: 600px;'>
<input type='image' value='8' name='input_from_test_1' src='8_button.png'>
</div>
<div style='position: absolute; left: 730px; top: 600px;'>
<input type='image' value='9' name='input_from_test_1' src='9_button.png'>
</div> ";
print "</form>";
this is just part of the code as the complete .php is quite long and complex.
The script works on Google Chrome but only for the first ~100 submitals
. After that I get a "No data received"
"Error code: ERR_EMPTY_RESPONSE".
With Firefox I get a similar error after many inputs "The connection was reset".
Is this just some error I can't avoid as the server will time out after so many form submitals?
When I get this error I have to wait ~30 seconds and refresh and then it sends a NULL value instead of the user input.
What are some alternatives I can use to do this differently. Is it okay to use
<input type='image' value='9' name='input_from_test_1' src='9_button.png'>
as a submit button?
Thank you