I just wanted to ask, since I'm coding a script, and I'm using time() as a salt for what I am doing.
Now what's happening is I'm salting the data sent from server 1, to server 2. Server 2 checks to see if the data = submitted_data + time() matches exactly. And I wanted to know, since my script will be used on different servers, will the time() function return the same value (if they're located in different parts of the world?)
A code example from the client is:
if($return == md5("true" . time()))
And a code example, where if the data that's submitted correctly, will return this:
echo md5('true' . time());
Both are on different servers in different parts of the world, but I wanted to know if using the time() will mess up the way my system's going to work..?
Why don't you try following :
echo date("Y-m-d H:i") echo strtotime(date("Y-m-d H:i"));
Value of strtotime(date("Y-m-d H:i")); would not change until you pass the next minute OR you can remove "i" based on your requirement.
Hope that helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With