Answered PHP Time

Kyle Fardy

Veteran
Donator
Messages
179
Reaction score
89
Points
888
right, I’m trying to make it so users can only reset their hwid every 3 months

Here’s how I’ve done it but I’ve never had to mess with php time before (I use timestamp)
 

Attachments

  • 2F15EEE6-0AD5-4278-8481-7D9D5F2A345C.jpeg
    2F15EEE6-0AD5-4278-8481-7D9D5F2A345C.jpeg
    72.1 KB · Views: 528

WW2

Known Member
Messages
62
Reaction score
123
Points
133
right, I’m trying to make it so users can only reset their hwid every 3 months

Here’s how I’ve done it but I’ve never had to mess with php time before (I use timestamp)
What is actually the question here? :thinking:
 

Kyle Fardy

Veteran
Donator
Messages
179
Reaction score
89
Points
888
What is actually the question here? :thinking:
im asking how the hell do i make it so if the time in the database is less than 3 months then throw them an error that says you need to wait x ammount of time

or if its 3 months or over then let them reset their hwid
 

Matt

Web Developer
Messages
245
Reaction score
215
Points
828
Surely it would make alot more sense to make an AI field that updates daily that counts to 90? This would allow you to simply run a query to get the datafield for the column of the specified id. Assign this to a variable, then compare this variable to be >=90?

Cuts a hell of alot of corners, but it's the simplest solution that I can see. Here's so pseudo code for this.

Code:
$con = new PDO("mysql:host=$serverinfo;dbname=$databasename", "$username", "password");
$check_time = $con->prepare("SELECT `reset_time` FROM `user_table` WHERE id=":userid"");
$check_time->exectute();
if($check_time >=90){
      //HWID reset functions here;
} else {
     //fail/errormessage here;
}


It's late, Ive been out all day with the Missus and had a few to drink, please let me know if this wasn't what you were asking for.
 
Last edited by a moderator:
Top