Bir web sayfasına (google çevirmek gibi) bir araç çubuğu eklemek için nasıl html / javascript ve php kullanarak tasarruf / işlem için bir link aracılığıyla açılan?

2 Cevap php

lets say I have bunch of hyperlinks. When link is clicked, I'd like an opened page (in a separate window) to have a google-translator style toolbox that I could use to save the page to a localdisk if I liked it, adding a few tags to the database using php. I understand how to save a file using php, but could You help me with ideas as how to add a toolbar and to send request from toolbar to my processing page? Here's graphic representation of my question.

alt text

2 Cevap

Sen bir sayfa olabilir ... araç çubuğunu ve size link GET parametresi olarak geçebilir URL'yi açmak verebilecek bir iframe içerir "extUrl" demek.

EDIT : I didn't use php for years so the code (untested) may need debug... your link could be something like : <a href="/extUrl.php?url=http://stackoverflow.com/">SO</a> And your extUrl.php file would look like :

[...]
<!-- here your toolbar -->
<?php
url = $GET['url'];
?>
<iframe src="<?php echo $url ?>"></iframe>

Teşekkürler, Vinze, sen yolda beni koyduk, ben kod çalışma var. Senin cevabı kabul.


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>