[英]Load Google Maps on webpage using Javascript and PHP through drop down form
[英]How to add a toolbar (like google translate) to a webpage opened through a link for saving/processing using html/javascript and php?
可以说我有一堆超链接。 单击链接后,我希望一个打开的页面(在单独的窗口中)具有一个google-translator样式的工具箱,如果我喜欢的话,可以将其保存到本地磁盘,并使用以下方式向数据库添加一些标签的PHP。 我了解如何使用php保存文件,但是您可以在如何添加工具栏以及将请求从工具栏发送到我的处理页面方面提供一些帮助吗? 这是我的问题的图形表示。
您可能会有一个页面...说“ 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>
谢谢,Vinze,您使我步入正轨,我的代码可以正常工作了。 我接受你的回答。
Links.html
<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>
iframe.php
<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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.