• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Help required

WebWatcher

New Member
Hello,

Just a quick php question that may be easy to do....

I need code that when a user joins it get the date and time and stores it in a database. Then I need code so when the user logs on next it checks to see if it is 48hrs since they joined and if so it changes a value in the database from no to yes!!

Your help will be much appreciated

Thanks
 
What I need is for it to get the exact time and then when they log in again get the exacgt time and do current time - original time and if the difference is 48hrs then change a value in the db.

Are you with me?
 
nah cronjob not the way to go. I need to get the original time in a string then check the new time in a string.

I need source code like this:

$value = Original time string - new time string

if($value is greater then 48hrs) then
Update table value to yes
else
do nothing
end if
 
You'd have to store it in a cookie, to get the time from when they last visited, but they could just delete cookies/or not have them on, and the time would be reset. It wouldn't even help if you took the time from a IP visiting you, then checked it against the database to see it if had been 24 hours, because that alone isn't suitable for many reasons, one being multiple visitors on the same IP.

What is this for?
 
Back
Top