1. how to determine whether the time format is correct 2. how to determine the user's logon permission

Source: Internet
Author: User
1. how to determine whether the time format is correct 2. how to determine the user's logon permission PHP

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.


Hope you can give me some advice


Reply to discussion (solution)



Thank you! come and give me some advice ....

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.

$ D = '000000'; if (date ('ymmd', strtotime ($ d) ==$ d) echo 'format is correct ';


If (! $ _ SERVER ['http _ referer']) die ('inaccessible ');

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.