Php multiple choice knob value or de-value

Source: Internet
Author: User
Php multi-choice button value or de-value for a php permission management, you need to use the multi-choice button to do, for example, the administrator wants to give a common user a permission, is to show him what he can see or make comments in that place, how should he write code? Thank you! ------ Solution ------------------ Basic code $ dict & nbsp; array () php multiple-choice button value or de-value
For php permission management, you need to select multiple buttons. for example, the administrator wants to give a common user a permission, that is, to give him what he can see or where he can make comments, how should I write code like this? Thank you!


------ Solution --------------------
Basic code
$dict = array();
if($_SERVER['REQUEST_METHOD'] == "POST") {
echo array_sum($_POST['r']);
$dict = $_POST['r'];
}
echo '';

------ Solution --------------------
The basic code has been provided to you,

At this time, you need to use your thinking to implement it from theory to practice.

For example

Customer management, contract management, financial management, work order management, basic management
01110
0 indicates permission control.
1. the code has no permission control.

Write data to the database, and then compare it when reading data. The corresponding executable permissions are given.

------ Solution --------------------
You cannot determine the checked attribute of the checkbox.

------ Solution --------------------
When you output the checkbox, you can judge it. refer to the moderator's code.
------ Solution --------------------
Reference:
Reference: you cannot determine the checked attribute of the checkbox.

1. 0: No. Is that true? But how does it automatically hook when it knows 1?



/>

------ Solution --------------------
The permission list can be one-to-one matched with the basis for judgment.
When displayed on the page, you can determine the value to control the checked attribute of the checkbox.
------ Solution --------------------
#10 it's very clear. you always emphasize that you are a newbie. if you don't even know html, no one else can help you.
Write the following two sentences in html to see the difference.


------ Solution --------------------
Sent and checked

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.