views:

67

answers:

2

hey guys,

for developement reasons (working with facebook-connect) i put the connect iframe in an iframe. on that way i am able to work on the connect-thing independent of my ip and don't have to develop on the live-server.

the iframe holding the connect-button iframe is on my server, accessing the same db-server as the developer version (developer version is running on localhsot).

as far as good ... BUT

how can i let the parent site know, that the user has connected, so that i get his profile-picture displayd as reaction to this? how can i react in generally on an action/event/JS in an iframe? is there a way? can the iframe post data to the parent site? like a time-stamp and fb_userid?

if the iframe stuff doesn't work ... i thougt of saving the ip to the fb_userid (to db) and check matches ... but i don't like this idea.

+1  A: 

You can pass variables to frames using query string format through src attribute of the iframe, eg:

<iframe src="mysite.com?var=test"............>
Sarfraz
cool, but i need the other way round
helle
A: 

well thanks to @Sarfraz Ahmed, your post was the inspiration for my solution:

with the src of the iframe i send the current session id as get parameter.

<ifram scr="http://www.online_host.com/scriptxy.php?id_session=&lt;?=session_id()?&gt;"&gt;&lt;/iframe&gt;

then the skript in the iframe makes a callback after some action, like

<javascript>
location.href="http://localhost/localscript.php?id_session=&lt;?=$_REQUEST['id_session']?&gt;&amp;...parameters...
</script>

it should be noticed, that the get-parameters name has not to be "sessionid", or "sessid", because this is not allowed with the most apache installations.

in php localscript.php ^^ you do something like:

session_id($_REQUEST['id_session']);
session_regenerate_id();

$_SESSION['param1'] = $_REQUEST['param1']
...

now you can access the sessiondata in your current locally running php. together with a triggered ajax request interval this works good enough for development.

the thing is, i'm using codeigniter (with postgersql and the session-plugin ecko) and getting a memory problem in the postresql driver script, which i didn't figure out until now ...

helle