Hy webmasters! I want to upload a file on my webhost, but i want to make it downloadable only if the page has a specific refferal. Can anyone help me with a kind of script for that? EDIT: solved:
if you mean the website that visitor came from so here yo are if($_SERVER['HTTP_REFERER'] == 'http://www.google.com'){ header("location:ref_page.php"); }else{ header("location:index.php"); } Code (markup): or $website = "google.com"; $match = strpos($_SERVER['HTTP_REFERER'], $website); if( $match === true){ header("location:ref_page.php"); }else{ header("location:index.php"); } Code (markup):