I'm trying to switch my websites meta search from iFrames to Frames. Mainly because a second scroll bar shows up which makes it look tacky.
Does anyone know how I could switch it to frames?
heres an example of the second scroll bar:
http://www.plentyoftorrents.com/sear...inova&q=ubuntu
I guess its because iFrames cannot display the external sites height.
Heres some of the code, let me know if you need to see anymore.
index page
Code:<form name="search" action="search.php" method="get"> <input type="text" style="width: 155px" name="q"> <select name="site" style="width: 140px"> <option>Btjunkie</option> </select> <input type="submit" id="button" style="cursor: pointer;" value="Go..."> </form>
search.php
Snippet from the menu.htmPHP Code:<?php
// grab the search query and request site from the url
if($_GET["q"]){
$q = $_GET["q"];
}else{
$q = $_GET['q'];
}
$q = htmlentities(stripslashes(trim($q)));
if($_GET['site']){
$site = $_GET["site"];
}else{
$site = $_GET['site'];
}
include('switch.php');
// finally create the code for the actual frames. This is simple HTML with the search query and site put into the menubar's url so we can change it later if wanted.
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Fastest Torrent Search - Plentyoftorrents.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style>
body{
width:100%;
height:100%;
margin:auto;
font-family:Arial, Helvetica, sans-serif;
}
#menu{
height:25px;
}
</style>
</head>
<body onload="autofitIframe('torrent_window')">
<?php
include('menu.htm');
?>
<!-- include the site in an iframe -->
<iframe id="torrent_window" src="<?php echo $url; ?>" scrolling="auto" width="100%" height="1200" name="torrent_window" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0"></iframe>
</body>
</html>
snippet from switch.phpCode:<?php // same as before, grab the search query to put into the different urls //$q = $_GET["q"]; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head><title>Torrents</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
PHP Code:<?php
// here we use a switch statement to define our url
switch ($site) {
case "Mininova":
$url = "http://www.mininova.org/search/?search=". $q;
break;
}
?>



Reply With Quote

Bookmarks