views:

228

answers:

1

hi, I'm running the CMS indexhibit, indexhibit uses an iframe to load it's content.

http://www.therussianfrostfarmers.com/

My homepage has WordPress loaded into this iframe, which works ok, i've got some scrollbar issues, but that another problem.

Currently, when ppl find a WP post through there search engine, the user is redirected to the homepage, i need to do this otherwise the user would only be able to view the WP content and not the rest of the site aswell. e.g ; http://www.therussianfrostfarmers.com/oldspeak/?p=480

What i need to do is to split the querystring, and send an 'id' into the iframe, which inturn would load the appropriate WP page inside the iframe.

I'm not sure where to start, Would i use PHP to split the querystring? and Javascript to target some iframe properties?

....any help would be much appreciated

thanks Cam

A: 

You might not have to split the query string. You could just use PHP to get the value of that GET variable, for instance:

$_GET["p"]

would equal 480 for the request http://www.therussianfrostfarmers.com/oldspeak/?p=480

then, you could just use the properties of the iFrame to change what it requests. I believe that the URL that the iFrame seeks is set in an HTML attribute. So you could just set the iframe URL to

http://www.yourwordpresssite.com/?p=<?php echo $_GET["p"]; ?>

Or a similar method.

Annath
Awesome, sorry i'm a noob when it comes PHP/JS, but does mean i'd get the value of "p", $_GET["p"], just before it redirects back to the homepage? e.gif (parent.location.href == self.location.href) {<?php $_GET["p"] ?>window.location.href = 'http:////www.therussianfrostfarmers.com';}again, sorry i'm complete novice
Cam
Yes. The php interpreter runs before any client side code(i.e. javascript) is run, so you will get the value of p before it executes the js.
Annath