Jump to content

Count Wrong Guess.


yakoup46

Recommended Posts

I am trying to keep track of the number of wrong guess' that someone has submitted. I am not really sure what to do, I want to avoid database entries, b/c the data is only purposeful per visit. So...

 

$box1 = 0;

 

if(isset($_POST['buttonsumofodds']) || $_POST['inputbox1'])

{

$sql="INSERT INTO Sumofodds (ValueOdds) VALUES ('$_POST[inputbox1]')";

 

if($_POST[inputbox1] != 280)

{

echo "Sorry Wrong!";

$box1++;

echo $box1;

}

else

{

echo "Correct!";

}

}

 

Obviously this code is just code to print "Sorry Wrong 1" and when they go back it try again and fail it will print "Sorry Wrong 1".

 

So, I was wondering if there was someway to track the IP address, or something, so the server noes to increase $box1 per IP address.

Link to comment
https://forums.phpfreaks.com/topic/198759-count-wrong-guess/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.