Jump to content

Send to "page" if not come from "page" Help


Andrew121007

Recommended Posts

I am making a store. And i am using paypal to make all the payments. Now i put the return URL to galkonspride.com/return.htm (Not real, just an example) and in that page i want to make a script that says if the person doesnt come from https://paypal.com/* then send him to fpsmedia.tk

 

Something like

If href!=https://paypal.com/*

{

header("fpsmedia.tk")

}

 

Im sure that is wrong but I cant remember much lol. Any help would be appreciated.

Link to comment
https://forums.phpfreaks.com/topic/111705-send-to-page-if-not-come-from-page-help/
Share on other sites

you can use HTTP_REFERER, but the client's browser is setting it, therefore it's not 100% guaranteed to be there or be correct.

 

<?php
  if($_SERVER['HTTP_REFERER'] && 'www.paypal.com' != parse_url($_SERVER['HTTP_REFERER],PHP_URL_HOST)){
    header("http://fpsmedia.tk");
    exit;
  }
  //Continue loading page
?>

what happens with this:

 

<?php
  if($_SERVER['HTTP_REFERER'] && 'www.paypal.com' != parse_url($_SERVER['HTTP_REFERER'],PHP_URL_HOST)){
    header("http://fpsmedia.tk");
    exit;
  }
  die("Got the URL: ".$_SERVER['HTTP_REFERER']);
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.