How can I link directly to a search result?
Posted: Tue Dec 02, 2008 10:07 am
My site sends searches from my main page to another torrent site in frames.
What I'm trying to do is enable the user to link directly to a torrent while staying in my frames, the only way to do this right now is to display a list of results on the external site. They cant link directly to a torrent and stay in frames http://www.plentyoftorrents.com/results ... untu+linux
Can anyone tell me how I could get this working?
Here is the search.php page that handles the form .
and here is the switch.php page that handles the sites search strings.
and the search form from the main page.
What I'm trying to do is enable the user to link directly to a torrent while staying in my frames, the only way to do this right now is to display a list of results on the external site. They cant link directly to a torrent and stay in frames http://www.plentyoftorrents.com/results ... untu+linux
Can anyone tell me how I could get this working?
Here is the search.php page that handles the form .
Code: Select all
<?php
// grab the search query and request site from the url
if($_POST["q"]){
$q = $_POST["q"];
}else{
$q = $_GET['q'];
}
$q = htmlentities(stripslashes(trim($q)));
if($_POST['site']){
$site = $_POST["site"];
}else{
$site = $_GET['site'];
}
include('switch.php');
?>Code: Select all
<?php
// here we use a switch statement to define our url
switch ($site) {
case "Mininova":
$url = "http://www.mininova.org/search/?search=". $q;
break;
case "Btjunkie":
$url = "http://btjunkie.org/search?q=". $q;
break;
case "Btleech":
$url = "http://btleech.com/search.php?q=". $q ."&cat=&min=min&max=max&submit=Torrents&adv=&br=";
break;Code: Select all
<center><form name="search" action="search.php" method="get">
<input type="text" style="width: 155px" name="q">
<select name="site" style="width: 140px">
<option>Mininova</option>
<option>Btjunkie</option>
<option>The Pirate Bay</option>
<option>Bitenova</option>
<option>Btmon</option>
<option>btscene</option>
<option>Isohunt</option>
<option>Torrentportal</option>
<option>Torrentvalley</option>
<option>Fenopy</option>
<option>Fulldls</option>
<option>EZTV</option>
<option>Torrentbox</option>
<option>Torrentz</option>
<option>Sumotorrents</option>
<option>Nutorrent</option>
</select>
<input type="submit" id="button" style="cursor: pointer;" value="Go...">
</form>
</center>