Page 1 of 1
How to have msql connect just in some preset time intervals?
Posted: Thu Oct 16, 2008 10:01 am
by phpnewbie3
I'm doing my own project for my own website, and I want to run a sports handicapping contest.
I have this problem to solve:
I would need that participants to be able to input data in the database just in some preset time intervals.
These would be between 11 AM EST -18.30 PM EST on weekdays (Monday-Friday)
and between 8.30 AM EST - 11.30 EST on weekends (Saturday - Sunday).
It's very important that these times must be is EST (New York's time).
There is any solution to this?
Something applying the if, else and elseif statements?
I'm using PHP.
Thanks in advance!

Re: How to have msql connect just in some preset time intervals?
Posted: Fri Oct 17, 2008 9:55 am
by phpnewbie3
Probably this can't be done...

Re: How to have msql connect just in some preset time intervals?
Posted: Fri Oct 17, 2008 11:49 am
by pavanpuligandla
I'm doing my own project for my own website, and I want to run a sports handicapping contest.
I have this problem to solve:
I would need that participants to be able to input data in the database just in some preset time intervals.
These would be between 11 AM EST -18.30 PM EST on weekdays (Monday-Friday)
and between 8.30 AM EST - 11.30 EST on weekends (Saturday - Sunday).
It's very important that these times must be is EST (New York's time).
There is any solution to this?
Something applying the if, else and elseif statements?
I'm using PHP.
Thanks in advance!

hii..
yes u can do it, but ur topic is related to php security..
my opinion is, u need to maintain a table for time stamps, and those who are able to insert or update the database.
track the time of each user, and if the time stamp is equal to ur predefined time., then block them, release after x hrs.. hope this may work..
i can give pseudo code;
get usrname
get timestamp
if (!time=predefined time of ur server){
//insert, update DB
}
else {
// write a query to block the user and update the time stamp after X hrs.
}
hope u understand..
Re: How to have msql connect just in some preset time intervals?
Posted: Fri Oct 17, 2008 4:54 pm
by califdon
phpnewbie3 wrote:I'm doing my own project for my own website, and I want to run a sports handicapping contest.
I have this problem to solve:
I would need that participants to be able to input data in the database just in some preset time intervals.
These would be between 11 AM EST -18.30 PM EST on weekdays (Monday-Friday)
and between 8.30 AM EST - 11.30 EST on weekends (Saturday - Sunday).
It's very important that these times must be is EST (New York's time).
There is any solution to this?
Something applying the if, else and elseif statements?
I'm using PHP.
Thanks in advance!

Just stop and think about it. All you need to do is have your PHP code test what the current time is when that page is requested and determine whether or not to allow the option to input data or not. The current time is determined by the server, so it doesn't matter what time it is at the requestor's location. I won't write your code for you, but there's nothing complicated about the idea. If the current time is not within your desired "windows", just display a notice that says something like, "Sorry, we only accept input at the following hours: ..." instead of displaying the input Form.