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?