khaldoon82 Posted January 16, 2010 Share Posted January 16, 2010 Hello there .. im trying to get an urgent code for my graduation project which is as the following using an iframe in ex. test.php that contains the following code <i frame src="test1.php" ></iframe> test1.php contains <a href="test2.php">click here </a> now in test2.php ,there should be a function that catchs the url referer of test.php not test1.php i have been searching for so long and no clue .. tried $_SERVER['HTTP_REFERER'] and getenv(HTTP_REFERER) and all return blank value ! is there any idea ? or if i could use a javascript code like google adsense ! or anything !! thank you for helping ! Link to comment https://forums.phpfreaks.com/topic/188652-urgent-help/ Share on other sites More sharing options...
JAY6390 Posted January 16, 2010 Share Posted January 16, 2010 does your server run on apache or another web server such as IIS? Link to comment https://forums.phpfreaks.com/topic/188652-urgent-help/#findComment-995955 Share on other sites More sharing options...
khaldoon82 Posted January 16, 2010 Author Share Posted January 16, 2010 Apachi server Link to comment https://forums.phpfreaks.com/topic/188652-urgent-help/#findComment-995957 Share on other sites More sharing options...
JAY6390 Posted January 16, 2010 Share Posted January 16, 2010 put this in your script and see if you can find the referrer key echo '<pre>'.print_r($_SERVER, true).'</pre>'; Link to comment https://forums.phpfreaks.com/topic/188652-urgent-help/#findComment-995961 Share on other sites More sharing options...
khaldoon82 Posted January 16, 2010 Author Share Posted January 16, 2010 it keeps giving me the url of tes1.php now if tes.php is located for example in www.domain1.com/tes.php and it contains <i frame src="www.domain2.com/test1.php" ></iframe> tes1.php which is from another domain name www.domain2.com/tes1.php contains <a href="www.domain3.com/test2.php">click here </a> when i click on that link in tes.php it should print welcome guest ,you were in "www.domain1.com/tes.php" not from www.domain2.com/tes1.php" in each time i try the known functions .. it shows me blank result in www.domain3.com/tes2.php !! any idea why ? Link to comment https://forums.phpfreaks.com/topic/188652-urgent-help/#findComment-995964 Share on other sites More sharing options...
khaldoon82 Posted January 16, 2010 Author Share Posted January 16, 2010 hello any clue ? Link to comment https://forums.phpfreaks.com/topic/188652-urgent-help/#findComment-995975 Share on other sites More sharing options...
khaldoon82 Posted January 16, 2010 Author Share Posted January 16, 2010 Hello anybody there ? Link to comment https://forums.phpfreaks.com/topic/188652-urgent-help/#findComment-996021 Share on other sites More sharing options...
trq Posted January 16, 2010 Share Posted January 16, 2010 Calm down, remove the urgency from your post and actually describe what your expecting, what your getting and how your getting it. Link to comment https://forums.phpfreaks.com/topic/188652-urgent-help/#findComment-996022 Share on other sites More sharing options...
ignace Posted January 16, 2010 Share Posted January 16, 2010 when i click on that link in tes.php it should print welcome guest ,you were in "www.domain1.com/tes.php" not from www.domain2.com/tes1.php" Yes it does if it wouldn't REFERER would be broken your iframe is the caller which is tes1 so last REFERER for tes2 is tes1 If you want tes the remove the iframe. Don't forget the iframe makes a different request (tes1) then your own (tes) Link to comment https://forums.phpfreaks.com/topic/188652-urgent-help/#findComment-996031 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.