creating Frames inside a PHP page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jcor
    New Member
    • Sep 2007
    • 63

    #1

    creating Frames inside a PHP page

    Hi, I'm a really newbie in php and need some help to get started, I read w3school tutorial but was to abstract, I guess, I need more real exemples.


    I have the PHP code of a website and I need to create a new page.

    I'm reusing the "header" because it's equal in every pages.

    But now I need to create something equivalent to frames: one top frame,
    a middle one divided in a menu on the left and a "mainframe" that changes with the option selected in the menu and a bottom one. I read a post that says I should to that with <div> and a CSS file, is this true in this case?
    Can someone give me some lights to get my page?

    Thanks,

    João Correia
  • aktar
    New Member
    • Jul 2006
    • 105

    #2
    This is something very simple.

    My advise to you is play about with your code

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      Dont understand what that has to do with PHP.

      Seems more like a html problem, to be honest.

      Regards.

      Comment

      • Atli
        Recognized Expert Expert
        • Nov 2006
        • 5062

        #4
        Hi.

        As Markus pointed out, this appears to be more of a HTML problem, so I have moved it over to the HTML/CSS forums.

        Comment

        • jcor
          New Member
          • Sep 2007
          • 63

          #5
          I initially posted it in PHP forum because I tought it might be some way to do this using PHP and not HTML.
          I tried to make it with HTML but my whole frameset doesn't seem to be visible inside my php page.
          If I put there just a simple html page, It's ok, If there is a frameset, I get nothing.

          Does anyone have any idea of what I am doing wrong?

          Thanks,

          João

          Comment

          • harshmaul
            Recognized Expert Contributor
            • Jul 2007
            • 490

            #6
            Originally posted by jcor
            Hi, I'm a really newbie in php and need some help to get started, I read w3school tutorial but was to abstract, I guess, I need more real exemples.


            I have the PHP code of a website and I need to create a new page.

            I'm reusing the "header" because it's equal in every pages.

            But now I need to create something equivalent to frames: one top frame,
            a middle one divided in a menu on the left and a "mainframe" that changes with the option selected in the menu and a bottom one. I read a post that says I should to that with <div> and a CSS file, is this true in this case?
            Can someone give me some lights to get my page?

            Thanks,

            João Correia
            Hi,
            divs and frames are very different.
            you can use frames to recreate the desired behaviour.

            A very quick tutorial......

            In one page (index.html) stick the below code.....

            [HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
            "http://www.w3.org/TR/html4/frameset.dtd">
            <html>
            <head>
            <title>Frame page</title>
            <style type="text/css">

            </style>
            </head>
            <frameset cols="25%,75%">
            <frame src="left.html" >
            <frame src="right.html " name="main_page ">
            <noframes>
            You need a browser that supports frames to use this
            </noframes>
            </frameset>
            </html>[/HTML]


            In another page in the same folder stick the following code (left.html)
            [HTML]
            <?xml version="1.0" encoding="utf-8"?>
            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
            "http://www.w3.org/TR/html4/loose.dtd">

            <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
            <head>
            <style type="text/css">

            </style>
            </head>
            <body>
            <div>
            <a href="http://www.google.com" target="main_pa ge">go to google</a>
            </div>
            </body>
            </html>[/HTML]

            let me know if that clears anything up....

            DISCLAIMER:
            you would be better off using CSS to layout your site

            Comment

            • jcor
              New Member
              • Sep 2007
              • 63

              #7
              I made something like that with dreamweaver (the frames stuff) but now I can´t put it inside my PHP page.
              The page acts like there is nothing there.
              I'm getting desperate!!
              I don't know if it's the size on the frameset, it just don't get there.
              If I include other basic htmll it works...

              Don't you want me to post some code here?


              Thanks,

              João Correia

              Comment

              • jcor
                New Member
                • Sep 2007
                • 63

                #8
                This is the code of my page:

                [PHP]<?
                session_start() ;
                if (!isset($lingua )) {
                session_registe r("lingua");
                $lingua="pt";
                }
                include "$DOCUMENT_ ROOT/lib/config.obj.php" ;
                include "$DOCUMENT_ ROOT/lib/globalserver.ob j.php";
                include "$DOCUMENT_ ROOT/include/topo.inc.php";


                require_once "$dir_site/clientes/clientes.obj.ph p";
                $clientes = new clientes();
                $clientes->Accao("Home" );
                unset($clientes );



                if(is_array($sk in_prog)){
                $img_top = $skin_prog[0];
                $img_bottom = $skin_prog[1];
                }else{
                include_once "$dir_site/banner/banner.obj.php" ;
                $dbconf = new banner();
                $banners_ar = $dbconf->PhpAdMentor_Ge tAd(8);
                $img_top = $banners_ar[0];
                $img_bottom = $banners_ar[1];

                ?>



                <?
                }
                ?>


                <frameset rows="182,*,80" cols="*" framespacing="0 " frameborder="no " border="0">
                <frame src="cabeçalho .html" name="topFrame" scrolling="No" noresize="nores ize" id="topFrame" title="topFrame " />
                <frameset rows="*" cols="*,754" framespacing="0 " frameborder="no " border="0">
                <frame src="pagina.htm l" name="mainFrame " id="mainFrame" title="mainFram e" />
                <frame src="perfil.htm l" name="rightFram e" scrolling="No" noresize="nores ize" id="rightFrame " title="rightFra me" />
                </frameset>
                <frame src="rodape.htm l" name="bottomFra me" scrolling="No" noresize="nores ize" id="bottomFrame " title="bottomFr ame" />
                </frameset>
                <noframes><body >
                <table width="200" border="1">
                <tr>
                <th scope="row">&nb sp;</th>
                </tr>
                <tr>
                <th scope="row">&nb sp;</th>
                </tr>
                <tr>
                <th scope="row">&nb sp;</th>
                </tr>
                <tr>
                <th scope="row">&nb sp;</th>
                </tr>
                </table>
                </body>
                </noframes></html>



                <?require "$DOCUMENT_ ROOT/include/rodape.inc_cale s.php";



                ?>

                [/PHP]

                [PHP]include "$DOCUMENT_ ROOT/include/topo.inc.php";[/PHP] is the header that I want to maintain.

                [PHP]
                <?require "$DOCUMENT_ ROOT/include/rodape.inc_cale s.php";[/PHP] This is the footer, some link in the bottom and an advertising banner that I want to maintain

                I want my frames to be in the middle o f this, like I tried by putting the html code in the file.

                I tried either to have another file "something.html " with the html code and call it in this one with require and include but didn't work.

                The most wired is that if I include some html file that is not a frameset or just write something, it works.

                The problems is in the frameset.

                Do you see something wrong here?

                Comment

                • jcor
                  New Member
                  • Sep 2007
                  • 63

                  #9
                  I solved it with tables and attribute display=''" and display=none.

                  thanks harshmaul for your help

                  Comment

                  • harshmaul
                    Recognized Expert Contributor
                    • Jul 2007
                    • 490

                    #10
                    bah... it was nothing.... seriously! your welcome mate!

                    Comment

                    Working...