Solved

Converting my frames page to div format

Posted on 2013-12-29
4
416 Views
Last Modified: 2013-12-29
I have the following php page with frames:

 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
   "http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>

</HEAD>
<FRAMESET cols="10%, 90%">
  <FRAMESET rows="10%, "90%">
      <FRAME name="status" id="status" src="status.php" scrolling="no" noresize="noresize" frameborder="0">
      <FRAME  name="menu" id="menu" src="menu.php"  scrolling="no" noresize="noresize" frameborder="0">
  </FRAMESET>
  <FRAMESET rows="20%, "80%">
      <FRAME name="logo" id="logo" src="logo.php"  scrolling="no" noresize="noresize" frameborder="0">
      <FRAME  name="main" id="main" src="login.php"  scrolling="yes" noresize="noresize" frameborder="0">
  </FRAMESET>
  <NOFRAMES>
      Sorry, your browser does not handle frames!
  </NOFRAMES>
</FRAMESET>
</HTML>

Open in new window



I have been advised that changing to css is more up to date, so I created the following instead:

<?php
session_start();
?>
<HTML>
<HEAD>
<style>
        .top {
                position:relative;
                height:10%;
                width:90%;
                border: none;
                overflow-y:hidden;
                overflow-x:hidden
        }
        .header {
                position:relative;
                height:100%;
                width:70%;
                border: none;
                overflow-y:hidden;
                overflow-x:hidden
        }

        .status {
                position:relative;
                height:100%;
                width:30%;
                border: none;
                overflow-y:hidden;
                overflow-x:hidden
        }
        .bottom {
                position:relative;
                height:90%;
                width:100%;
                border: none;
                overflow-y:hidden;
                overflow-x:hidden
        }
        .menu {
                position:relative;
                height:100%;
                width:20%;
                border: none;
                overflow-y:hidden;
                overflow-x:hidden
        }
        .main {
                position:relative;
                height:100%;
                width:80%;
                border: none;
                overflow-y:hidden;
                overflow-x:hidden
        }

</style>
</HEAD>
<BODY>
<div class="top" name="top" id="top">
 <div class="status" name="status" id="status">
   <?php include("status.php"); ?>
 </div>
 <div class="header" name="header" id="header">
   <?php include("header.php"); ?>
 </div>
</div>
<div class="bottom" name="bottom" id="bottom">
 <div class="menu" name="menu" id="menu">
   <?php include("menu.php"); ?>
 </div>
 <div class="main" name="main" id="main">
   <?php include("login.php"); ?>
 </div>
</div>
</BODY>
</HTML>

Open in new window


And here are the php pages I am trying to display:
Header.php:

<?php
if(!isset($_SESSION)){
    session_start();
}
?>
    <head>
        <link rel="stylesheet" href="css/jquery.ui.all.css">
        <link rel="stylesheet" href="css/ribbon.css">
        <link rel="stylesheet" href="css/demos.css">
        <style>
           #toolbar {
                        padding: 4px;
                        background: #CEF6F5;
                        display: inline-block;
                }
                /* support: IE7 */
            *+html #toolbar {
                        display: inline;
                }
            .ui-menu {
                      width: 150px;
                      background: #FAFAFA;
                     }
        </style>
        <meta charset="utf-8">
                <script src="js/jquery-1.10.1.min.js"></script>
                <script src="js/jquery-ui-1.10.3.custom.min.js"></script>
                <script>
                 $(function() {
                        var $logout = $("#logout").button({ text: false, icons: { primary: "ui-icon-key" } });
                        var $settings = $("#settings").button({ text: false, icons: { primary: "ui-icon-gear", secondary: "ui-icon-triangle-1-s" } });
                        var $menu = $("#settings").parent().next().show();

                $(document).click(function() {
                        $menu.hide();
                $settings.removeClass("active");
                });

                $settings.click(function(evt) {
                        evt.stopImmediatePropagation();
                        $(this).toggleClass("active")
                        $menu.css("display", $(this).hasClass("active")?"block":"none");
                        $menu.position({ my: "left top", at: "left bottom", of: this });
                        });

                $settings.parent().buttonset().next().hide().menu();

                $menu.hover(function() {
                $(this).addClass("overme");
                }, function() {
                        if($(this).hasClass("overme")) {
                                $(this).hide();
                                $(this).removeClass("overme");
                                $settings.removeClass("active");
                                }
                        });

                $menu.click(function(evt) {
                        alert($(evt.target).text());
                        });
                $("#toolbar").hide();
                });
                </script>



 </head>
 <body bgcolor="white">
<div id="header">
<div class="ribbon"><div class="ribbon-stitches-top"></div>
<strong class="ribbon-content"><img src="../images/hassans.gif" alt="Hassans" width="150" height="75"></strong>
<div class="ribbon-stitches-bottom"></div></div>
<div id="menu"  style="text-align: right">
<div id="toolbar" class="ui-widget-header ui-corner-all">
<button id="logout">Logout</button>
<button id="settings">Settings</button>
</div>
  <ul id="menu" >
    <li><a href="#">Open...</a></li>
    <li><a href="#">Save</a></li>
    <li><a href="#">Delete</a></li>
  </ul>
</div>
</div>
 </body>

Open in new window


And here is my menu.php:
<?php
if(!isset($_SESSION)){
    session_start();
}
?>
<html>
    <head>
    </head>
<body bgcolor="white">
</body>
</html>

Open in new window


And here my status.php:

<?php
if(!isset($_SESSION)){
    session_start();
}
?>
<html>
    <head>
    </head>
<body bgcolor="white">
</body>
</html>

Open in new window


And here is my login.php
<?php
if(!isset($_SESSION)){
    session_start();
}
?>
<!doctype html>

<head>

        <!-- Basics -->

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

        <title>Login</title>

        <!-- CSS -->

        <link rel="stylesheet" href="css/reset.css">
        <link rel="stylesheet" href="css/animate.css">
        <link rel="stylesheet" href="css/styles.css">

</head>

        <!-- Main HTML -->

<body>

        <!-- Begin Page Content -->

        <div id="container">

                <form autocomplete="off" action="check_login.php" method="POST">

                <label for="name">Username:</label>

                <input type="name" name="username" onclick="this.value=''" />

                <label for="username">Password:</label>

                <p><a href="#">Forgot your password?</a>

                <input type="password" name="password" onclick="this.value=''" />

                <img id="siimage" style="border: 1px solid #000; margin-right: 15px" src="securimage/securimage_show.php?sid=<?php echo md5(uniqid()) ?>" alt="CAPTCHA Image" align="center" onclick="this.blur()" />

                <object type="application/x-shockwave-flash" data="securimage/securimage_play.swf?bgcol=#ffffff&amp;icon_file=securimage/images/audio_icon.png&amp;audio_file=securimage/securimage_play.php" width="20" height="20">
                <param name="movie" value="securimage/securimage_play.swf?bgcol=#ffffff&amp;icon_file=securimage/images/audio_icon.png&amp;audio_file=securimage/securimage_play.php" />
                </object>


                <a id="refresh" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = 'securimage/securimage_show.php?sid=' + Math.random(); this.blur(); return false">

                <img src="images/refresh.png" alt="Reload Image" height="20" width="20" onclick="this.blur()" align="bottom" border="0" />

                </a>

                <input type="captcha" name="captcha_code" onclick="this.value=''" placeholder="Enter Code" />

                <div id="lower">

                <input type="checkbox" name="keepMe" value="true" ><label class="check" for="checkbox">Keep me logged in</label>

                <input type="submit" value="Login">

                </div>

                </form>

        </div>

        <!-- End Page Content -->
<script src="js/jquery-1.10.1.min.js"></script>
<script type="text/javascript">
    $.noConflict();

    function reloadCaptcha()
    {
        jQuery('#siimage').src = 'securimage/securimage_show.php?sid=' + Math.random();
    }

</script>


</body>

Open in new window


For some reason the heade.php is never displayed, can someone tell me what I am doing wrong (I am pretty sure I am doing a lot worng) :-(
0
Comment
Question by:Ashraf Hassanein
  • 2
  • 2
4 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39744822
You should only have one head, body tag etc in the page - you currently have them multiple times because all your include files have a full page structure.
So move all your style, script and meta tags to the parent page (the one where you are including the other files)
For the included files remove everything except the content inside the body tags. e.g. your login page should just be

        <div id="container">

                <form autocomplete="off" action="check_login.php" method="POST">

                <label for="name">Username:</label>

                <input type="name" name="username" onclick="this.value=''" />

                <label for="username">Password:</label>

                <p><a href="#">Forgot your password?</a>

                <input type="password" name="password" onclick="this.value=''" />

                <img id="siimage" style="border: 1px solid #000; margin-right: 15px" src="securimage/securimage_show.php?sid=<?php echo md5(uniqid()) ?>" alt="CAPTCHA Image" align="center" onclick="this.blur()" />

                <object type="application/x-shockwave-flash" data="securimage/securimage_play.swf?bgcol=#ffffff&amp;icon_file=securimage/images/audio_icon.png&amp;audio_file=securimage/securimage_play.php" width="20" height="20">
                <param name="movie" value="securimage/securimage_play.swf?bgcol=#ffffff&amp;icon_file=securimage/images/audio_icon.png&amp;audio_file=securimage/securimage_play.php" />
                </object>


                <a id="refresh" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = 'securimage/securimage_show.php?sid=' + Math.random(); this.blur(); return false">

                <img src="images/refresh.png" alt="Reload Image" height="20" width="20" onclick="this.blur()" align="bottom" border="0" />

                </a>

                <input type="captcha" name="captcha_code" onclick="this.value=''" placeholder="Enter Code" />

                <div id="lower">

                <input type="checkbox" name="keepMe" value="true" ><label class="check" for="checkbox">Keep me logged in</label>

                <input type="submit" value="Login">

                </div>

                </form>

        </div>
<script type="text/javascript">
    $.noConflict();

    function reloadCaptcha()
    {
        jQuery('#siimage').src = 'securimage/securimage_show.php?sid=' + Math.random();
    }

</script>

Open in new window

0
 

Author Comment

by:Ashraf Hassanein
ID: 39744843
But how to include additional CSS file for only login.php?
0
 
LVL 58

Expert Comment

by:Gary
ID: 39744863
The general logic of web design is that you have all your css in one file that is included in every page, ditto for your javascript.
You don't have bits of css scattered around different pages
0
 

Author Comment

by:Ashraf Hassanein
ID: 39745052
Hi Gary thank you so much for your support
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now