I am currently on contract to be a webmaster for a company, and an individual asked me the other day if it would be possible to automatically 'end' (shut down, not allow any other submissions etc) an html form after a certain amount of submissions.
I've been trying to figure out a way to do this.. and thought maybe someone on here would be able to brainstorm with me
The form is currently using php to add the information to a data base and is in the form of;
if(!isset) {
// Display form if submit button has not been pushed}
else{
// Submit form}
I am really new to php, and databases.. but I'm starting to get the hang of it. Anyways.. the database is set up with a primary key that auto_increments.. so my thought process is;
if( largest primary key < max number of submissions) {
//do above
}
else{
//show error message
}
I think this will work.. but I have no idea on how to do a query to only take the latest submission from the database (and thus the largest primary key).. does anyone know? Also.. what if two people are on the page at once? How can I account for that?
Or does anyone know of a different/easier way to do this?
Thanks!
