A confusing question about webpage content permissions for a long time

Source: Internet
Author: User
A question about webpage content permissions that has been confusing for a long time is that visitors cannot see it [! -- Ic. The following code can still be viewed by visitors [! -- Ic --] content in the field, you can also see [! -- Goneng --] the content in the field is to prevent visitors from viewing the content in my restricted field! & Lt ;! -- Code. start -- & gt ;? If ($ _ COOKIE [mvupamlgroupid]) a question about the permissions of webpage content that has been confusing for a long time
My requirement is that visitors cannot see [! -- Ic.

The following code can still be viewed by visitors [! -- Ic --] content in the field, you can also see [! -- Goneng --] content in the field

I mean, I don't want visitors to view the content in my restricted fields!

?
If ($ _ COOKIE [mvupamlgroupid])
{
Echo "[! -- Ic --] ";
}
Elseif ($ _ COOKIE [mvupamlgroupid] = 1)
{
Echo "[! -- Goneng --] ";
}

?




$ Phome_cookievarpre = "mvupa"; // prefix of the foreground cookie variable
$ Phome_cookieadminvarpre = "tbslm"; // background cookie variable prefix


How can this problem be solved? The above code is not displayed on the generated page.

------ Solution --------------------
?
If ($ _ COOKIE [mvupamlgroupid])
{
Echo "[! -- Ic --] ";
}
Elseif ($ _ COOKIE [mvupamlgroupid] = 1)
{
Echo "[! -- Goneng --] ";
}

?

$ Phome_cookievarpre = "mvupa"; // prefix of the foreground cookie variable
$ Phome_cookieadminvarpre = "tbslm"; // background cookie variable prefix

The cookie variable names are not uniform.

------ Solution --------------------
Discussion
My requirement is that visitors cannot see [! -- Ic.

The following code can still be viewed by visitors [! -- Ic --] content in the field, you can also see [! -- Goneng --] content in the field

I mean, I don't want visitors to view the content in my restricted fields!

?
If ($ _ COOKIE [mvupamlgroupid])
{
Echo "[! -- Ic --] ";
}
Els ......

------ Solution --------------------
Have you set cookies?
Setcookie ('mvupamlgroupid ', 1 );
------ Solution --------------------
Discussion

Back to the fifth floor, I didn't set the cookie to be the default,

I just added the variable name here. mvupamlgroupid

------ Solution --------------------
Don't worry about it. you can print out the value in $ _ COOKIE.
------ Solution --------------------
Have visitors updated the cookie value after logging on?
Check whether the value of the variable in the cookie changes.
------ Solution --------------------
You can print it out with print_r ($ _ COOKIE) to see the effect. It is best to add a die () and then debug one line at a time.

Also, what do you mean by not seeing the code. What code do you want to see?

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.