SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Kitty Lizard reptilianfeline's Avatar
    Join Date
    Aug 2002
    Location
    Somewhere in Cyberspace
    Posts
    385
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Putting content back into frame

    I have found a small java sript that puts the content in it's right frame when it's found through search engines for example. I know I can make people get into the frameset by clicking a link placed on the page, but I wanted something automatic, and the javascript I found does that.

    So... a person searches google for something, and (because I know how to make my frames search engine friendly) some of my pages show up. They should of course be loaded inside the frameset, but when the person clicks the link in google, he only gets the content-page, not the frameset as well. This is fixed with a small javascript that fetches the frameset and then places the content in the right frame.

    Now I want something else...
    I want to do the same thing in PHP and with an added thing that disables the feature when the page is loaded in a browser where frames are dissabled or otherwise don't work. (Or maybe that is automatically taken care of?) I was looking at the require() and include(), but I don't think they fit. I don't know if I just replaces the javascript tag with the php tag. I've searched for the answer on google and here and some other places, and can't find anything that does what I want. It has to be something simple in the beginning of the content-pages, that creates a variable of the name of the page, then loads the frameset with the variable in the right frame. And then maybe an "or else" with a redirection to the non-framed version of the site. Simple and fast loading.
    Reptilian Feline
    | www.reptilian-feline.net | Art | Tutorials | Pets | Music |
    Webdesign the hard way...

  2. #2
    Kitty Lizard reptilianfeline's Avatar
    Join Date
    Aug 2002
    Location
    Somewhere in Cyberspace
    Posts
    385
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well... I've been away during the weekend and was hoping to find at least ONE answer... *sigh*

    If this is something that can't be done, please say so, or point me to a tutorial that explaines how to do it, or give me a code snippet I can work with...

    Please!!!
    Reptilian Feline
    | www.reptilian-feline.net | Art | Tutorials | Pets | Music |
    Webdesign the hard way...

  3. #3
    Kitty Lizard reptilianfeline's Avatar
    Join Date
    Aug 2002
    Location
    Somewhere in Cyberspace
    Posts
    385
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK... I don't know why no one want's to help me

    Here is something I've been playing around with using info found in the forum. It doesn't work properly, and I need some help figuring out where it goes wrong. I think it is in the testing.php file.

    frameset.php
    <?
    if ($frame == top) {
    ?>
    <?php include('top.html'); ?>
    <?
    }
    elseif ($frame == menu) {
    ?>
    <?php include('menu.html'); ?>
    <?
    }
    elseif ($frame == info) {
    ?>
    <?php include('info.php'); ?>
    <?
    }
    else {
    ?>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv=
    "Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <frameset rows=
    "80,*" frameborder="NO" border="0" framespacing="0"> "
    <frame name=
    "top" scrolling="NO" noresize src="""frameset.php?frame=top" >
    <frameset cols=
    "80,*" frameborder="NO" border="0" framespacing="0"> "
    <frame name=
    "menu" scrolling="NO" noresize src="""frameset.php?frame=menu">
    <?
    if ($page) {
    echo (
    "<frame name=\"main\" src=""\"".$page."\" scrolling=\"auto\" marginwidth=\"0\" marginheight=\"0\" noresize>" );
    } else {
    echo (
    "<frame name=\"main\" src=""\"info.php\" scrolling=\"auto\" marginwidth=\"0\" marginheight=\"0\" noresize>" );
    }
    ?>
    </frameset>
    </frameset>
    <noframes><body bgcolor=
    "#FFFFFF" text="#000000">
    </body></noframes>
    </html>
    <?
    }
    ?>


    And testing.php
    <?php
    $page=substr(
    "$PHP_SELF", 1)
    ?>
    <? require('frameset.php'); ?>
    <!DOCTYPE HTML PUBLIC
    "-//W3C//DTD HTML 4.0 Transitional//EN">

    <html>
    <head>
    <title>Untitled</title>
    </head>

    <body>

    Testing

    </body>
    </html>


    Try it here: www.reptilian-feline.net/testing.php
    It doesn't look good of course because the frameset needs to be adjusted, but I need to get it working in the first place before I fix the smaller parts.
    Last edited by reptilianfeline; Mar 18, 2003 at 08:59.
    Reptilian Feline
    | www.reptilian-feline.net | Art | Tutorials | Pets | Music |
    Webdesign the hard way...


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
  •