TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 10-22-2009, 02:12 PM   #1 (permalink)
The Visitor
 
Join Date: Oct 2009
Posts: 4
Thanks: 2
n1colius is on a distinguished road
Default [ASK] get parent url in iframe

I have a proble in getting parent url address in iframe from my project.

so, i have let's say ads.php located in www.domain1.com/ads.php
it's look like this
Code:
<?php
//iklan.php
if($_GET['klik'] == 'yes')
{
    //klik process
    exit;
}

$some_content = '
	document.write('<iframe src="www.domain1.com/ads.php">
	<a href="www.domain1.com/ads.php&klik=yes">klik_link</a>
	</iframe>');
	';
echo $some_content;
?>
and then i have test.html located in www.domain2.com/test.html that look like this
Code:
<html>
<head>
</head>
<body>
<script type="text/javascript" src="www.domain1.com/ads.php">
</script>
</body>
</html>
my question is, how can i get the value of url address frame parent which is "www.domain2.com/test.html" in my ads.php file.

i already try $_SERVER['HTTP_REFERER'] and $_SERVER['SERVER_NAME'] but i got me "www.domain1.com/ads.php" which is the src of my iframe.

i also try with javascript "parent.location.href" but failed, because it's only work if the domain is the same.

anyone has a solution? been struggling with this in this 2 day.
Send a message via Yahoo to n1colius
n1colius is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
When a parent row is deleted.. Haris MySQL & Databases 3 12-30-2007 01:52 PM


All times are GMT. The time now is 02:50 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design