dsqdpn31467 2009-05-11 02:11
浏览 78
已采纳

定位iframe中的特定网页

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

  • 写回答

1条回答 默认 最新

  • dongxing4643 2009-05-11 02:31
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突