Jump to content

Global Variable/Quota System


ironica

Recommended Posts

Is there a way of implementing something of a global variable, or a global counter for forms, so that I can set up a quota system for a reservations form and track each successful reservation?

 

i.e. if (counter* < 20)

              echo option for 5:30 to 6:00

 

where counter is the number of times anyone has submitted the form with that option? it works perfectly, except for , well, the counter part ;p

 

 

I tried using a file but that just ended sour.

Link to comment
https://forums.phpfreaks.com/topic/87622-global-variablequota-system/
Share on other sites

A database would make life so much simpler, especially if you're trying to eliminate multiple reservations of the same time etc.  The only way to do it (apart from files like you said) would be to edit the reservation form each time someone submits a reservation, so that the specific time/date is disabled or something.  But that sounds insane!  Consider a database, they're speedy and you can avoid duplicate bookings with ease.

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.