html - How to check the incoming link in PHP -
I am writing a PHP module where I have to check that incoming links are coming from a particular page.
I have 2 pages:
- Services.php: I have
href something like this
& lt; A href = "product.php" & gt; Subscribe now & lt; / A & gt; Product.php: Here I check here using the following codes from the link services.php:
>
< Code> $ ref_url = $ _SERVER ['HTTP_REFERER']; $ RefData = parse_url ($ ref_url); If (stropo ($ refData ['path'], 'services.php')! == incorrect) {// Subscription_Module} else {// Other}
Unless user
& lt; clicks on a href = "product.php", works fine until then; & Gt; Subscribe now & lt; / A & gt; Although
However, there is a side effect, when the user is on the services.php page and then clicks on product.php on the header, then it executes < Code> Subscribe_module Any ideas in PHP, how to fix it?
thanks
simple, nest another loop if
(stroffo $ refData ['path'], 'services.php') == incorrect) {if ($ _ SERVER ['REQUEST_URI'] == abc / services.php) {// call service function} else {// Subscription_Module} } And {// Other}
Comments
Post a Comment