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