Results 1 to 3 of 3

Thread: Changing from iFrames to Frames

  1. #1
    Join Date
    Oct 2008
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Post Changing from iFrames to Frames

    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



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

    Code:
    <?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 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;
    }
    ?>

  2. #2
    Join Date
    Oct 2008
    Posts
    60
    Thanks
    2
    Thanked 7 Times in 7 Posts

    Default Changing from iFrames to Frames

    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/dow...Language=en-us

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

  3. #3
    Join Date
    Oct 2008
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by fobos View Post
    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/dow...Language=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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •