Log in

View Full Version : Changing from iFrames to Frames



eve55
07-18-2009, 02:44 PM
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/search.php?site=Mininova&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

<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



<?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 the menu.htm



<?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"/>


snippet from switch.php


<?php
// here we use a switch statement to define our url
switch ($site) {
case "Mininova":
$url = "http://www.mininova.org/search/?search=". $q;
break;
}
?>

fobos
07-18-2009, 08:25 PM
why dont you use auto height in your iframes...

ppl say that it cannot be done but here is an example of "Auto iframe height".
i know it works because i copied it.

http://support.asus.com/download/download.aspx?SLanguage=en-us

if you need the coding let me know, if not just save that page and you get all the files for it.

eve55
07-19-2009, 12:42 PM
why dont you use auto height in your iframes...

ppl say that it cannot be done but here is an example of "Auto iframe height".
i know it works because i copied it.

http://support.asus.com/download/download.aspx?SLanguage=en-us

if you need the coding let me know, if not just save that page and you get all the files for it.

I dont think those are external webpages though. They are all on asus's main site. What Im trying to do is get someone elses torrent site to display in my frames. Sometimes there are hundreds of results to show which will stretch the page to the height of 1300px then sometimes theres only 3 results.:(