1. how to determine whether the time format is correct 2. how to determine user logon permissions 1. how to determine whether the time format is correct: & nbsp; for example, if I need a format like & nbsp; 20110603 & nbsp;, this format is entered by the user, how to determine whether the user entered meets this specification? & nbsp; & nbs 1. how to determine whether the time format is correct 2. how to determine user logon permissions
1. determine whether the time format is correct:
For example, I need a format like 20110603, which is filled by the user. how can I determine whether the user entered meets this specification,
Code references
2. how to determine user logon permissions:
For example, after a user logs on, copy an address path and set it to inaccessible to the user.
I hope you can give me some advice on PHP:
------ Solution --------------------
1. date controls can be used
2. you need to have a permission table to record the user ID and link. when the user accesses this link, determine whether the permission table has the corresponding user ID.
------ Solution --------------------
$ D = '000000 ';
If (date ('ymmd', strtotime ($ d) = $ d) echo 'format is correct ';
If (! $ _ SERVER ['http _ referer']) die ('inaccessible ');