1. How to determine if the time format is correct 2. How to determine user logon permissions

Source: Internet
Author: User
Php

1. How to determine if the time format is correct:

Such as: I need 20110603 such format, this format is the user to fill in, how to determine whether users fill in compliance with this specification,
Need code for reference

2. How to determine user logon permissions:

such as: After the user logs in, copy an address path to link, set to user cannot access this path, need code reference


I hope the gods are pointing out


Reply to discussion (solution)



Great God, come and show me ....

1. You can use the date control http://www.my97.net/or regular match http://hi.baidu.com/tuqin526/item/f1a0becfae508435459416ab
2. A permission table is required to record the user ID and link, and when the user accesses the link, determine if there is a corresponding user ID in the permission table

$d = ' 20110603 '; if (date (' Ymd ', Strtotime ($d)) = = $d) echo ' format correct ';


if (! $_server[' Http_referer ') die (' No access ');
  • 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.