I want to add user system’s “date and time” verification service to my PHP website just like google. When a user tries to access my website, my site has to check the users system date and time and if the users system date and time is correct, then only allow the user to my site otherwise show an error message.
I have implemented two logic for this but they are not working as expected –
LOGIC 1: Get user system’s date and time and compare it with each country’s date and time on the world, and if any one country’s date and time matches with user system’s date and time then allow user otherwise show error. (This logic is very heavy and affects the performance of the website so it is not reliable).
LOGIC 2: Get user system’s date and time and compare it with my server’s date and time, and if it matches then allow user otherwise show error. (This logic will work for only one country so it is also not reliable).
Both the logics are not working for me. Also, I have found some articles on NTP (Network Time Protocol) but I am not able to understand it properly due to very limited resources.
If anyone has prior experience of implementing this type of logic please help me out a bit.