Php judgment solution

Source: Internet
Author: User
Php judges that there is a page a with the following content. Jump to another page through meta B. php & lt; meta & nbsp; http-equiv = "refresh" & nbsp; content = "5; & nbsp; url = http:// B .php" & nbsp;/& gt; 1, open php to determine
There is a page a with the following content.
Jump to another page through meta B. php


1. open page a and enter B. php
2. open B. php directly.
Both methods enable B. php.
Problem
On the B. php page, how can I determine whether to enable the first or second method?
Html? Refresh? Php
------ Solution --------------------
You can use jquery cookie to determine
A plug-in: https://github.com/carhartl/jquery-cookie

Page
$ (Document). ready (function (){
$. Cookie ('custom cookie name', ''); // clear the cookie when loading A page for reuse.
}
$ ('A'). click (function (){
$. Cookie ('custom cookie name', 'custom cookie value'); // Click the hyperlink to set cockie
}

Page B,
If ($ _ COOKIE ['custom cookie name'] = 'custom cookie value '){
// Condition 2. open B. php directly.
} Else {
// Condition 1: meta jump
}
------ Solution --------------------
I tried a lot of browsers.
We found that chrome, pera, and afari can determine the source by the Referer in the request header, and neither ie ff can...

If you click a to connect to the past
After testing, Referer has Records.
------ Solution --------------------
Php header cannot obtain referer
However, js and meta redirection can be obtained, and can be determined using server. referer.
As some browser mentioned above won't work, I'm not sure.
------ Solution --------------------
You can use $ _ SERVER ['http _ referer'] to determine
------ Solution --------------------
You can use js to determine the source.
------ Solution --------------------
Never use Referer for key judgment, but only for reference data

If both A and B are controllable, use session for key judgment.
If A is uncontrollable or untrusted, do not use this idea for important subsequent work judgment.
------ Solution --------------------
There is a stupid way
------ Solution --------------------
Agree to the 4th floor...
------ Solution --------------------
Reference:
Reference: php header cannot obtain referer
However, js and meta redirection can be obtained, and can be determined using server. referer.
As some browser mentioned above won't work, I'm not sure.
What does not get it mean ????
I can get referer for getallheaders ().
What do you mean if you cannot get it ??
Please advise !!!!

A connects to B, but B php header to c,
In c, if B is not obtained, a is obtained.
------ Solution --------------------
Mark a parameter

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.