yakoup46 Posted April 16, 2010 Share Posted April 16, 2010 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 More sharing options...
Ken2k7 Posted April 16, 2010 Share Posted April 16, 2010 Use session. Link to comment https://forums.phpfreaks.com/topic/198759-count-wrong-guess/#findComment-1043137 Share on other sites More sharing options...
yakoup46 Posted April 16, 2010 Author Share Posted April 16, 2010 OMG!!! Duh I am an idiot! Thanks. Link to comment https://forums.phpfreaks.com/topic/198759-count-wrong-guess/#findComment-1043142 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.