代码之家  ›  专栏  ›  技术社区  ›  arunas_t

如何向通过链接打开的网页添加工具栏(如googletranslate),以便使用html/javascript和php保存/处理?

  •  0
  • arunas_t  · 技术社区  · 16 年前

    这是我问题的图示。

    alt text

    2 回复  |  直到 9 年前
        1
  •  3
  •   Vinze    16 年前

    你可以有一页。。。说“extUrl”,它包含工具栏和iframe,您可以在其中打开链接作为GET参数传递的URL。

    编辑:我没有使用php多年,所以代码(未测试)可能需要调试。。。 你的链接可以是: <a href="/extUrl.php?url=http://stackoverflow.com/">SO</a> 您的extUrl.php文件如下所示:

    [...]
    <!-- here your toolbar -->
    <?php
    url = $GET['url'];
    ?>
    <iframe src="<?php echo $url ?>"></iframe>
    
        2
  •  0
  •   arunas_t    16 年前


    <html>
    <head>
    <title> Links</title>
    </head>
    <body>
    <a href="iframe.php?pg=http://www.google.com" target="_blank">Google</a>
    <br />
    <a href="iframe.php?pg=http://www.yahoo.com" target="_blank">Yahoo</a>
    <br />
    <a href="iframe.php?pg=http://www.ebay.com" target="_blank">Ebay</a>
    </body>
    </html>
    

    <html>
    <body>
    <div class="toolbar">The toolbar will be here</div>
    <br /><br />
    <?php 
    if (!isset($_GET['pg'])) {
    $target = "empty.html"; 
    } else {
    $target = $_GET['pg'];
    }
    ?>
      <center> 
        <iframe src="<?php print $target; ?>" name="content" frameborder="0" width="100%" height="80%"> 
        </iframe> 
       </center>
    </body>
    </html>