What i am trying to do it to make the php say "if the current url is www.mysite.com/image.php view the image, and if its not to go to www.dontleach.com."
ex:
if {someone views the image from the image gallary script i have which its url is index.php it shows the image
}else{ if they are viewing the image alone (the url is image?id=picture) then go to dontleach.com
<?php
$id = $_GET['id'];
//not sure if this is how toy specify the page
$mypage = 'www.mysite.com/index.php';
//dont know how to fech the current page help!
$currentpage = header('www.mysite.com/index.php');
//check to see if they are the same
if($mypage != $currentpage); //not sure if this is right tho
{
Header("Content-Type: image/gif");
$fn=fopen("./$id.jpg","r");
fpassthru($fn);
}else{
header("Location: [url]http://www.someothersite.com[/url]");
}
?>
i was trying to do the script but i could get it to work.. please help 🙂