PHP - Can't See Footer
Any idea why I can't see the footer on my index page?
this is index.php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <TITLE>Seare</TITLE> <script language="JavaScript">function parentTop(){ parent.window.location.hash = '#top';}</script> <script language="JavaScript"> <!-- function calcHeight() { //find the height of the internal page var the_height= document.getElementById('the_iframe').contentWindow. document.body.scrollHeight; //change the height of the iframe document.getElementById('the_iframe').height= the_height; } //--> </script> <style type="text/css"> #nav-menu ul p { font-family: verdana ; } p { font-size: 20px; } { list-style: none; padding: 0; margin: 0; } #nav-menu li { float: left; margin: 0 0.15em; } #nav-menu li a { height: 2em; line-height: 2em; float: left; width: 10em; display: block; color: #000000; text-decoration: none; text-align: center; border-bottom: 1px solid white; } /* Hide from IE5-Mac \*/ #nav-menu li a { float: none } /* End hide */ #nav-menu { width:90em } </style> </HEAD> <BODY > <p id="start"></p> <DIV style="position:absolute;left:0px;top:0px;width:100%;height:100%;z-index:1" align="left"> <TABLE width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"> <img src="seare.jpg" width="1259" height="170" /> </TABLE></DIV> <div id="nav-menu" style="position:absolute;center:0px;top:143px;width:100%;height:100%;z-index:1" align="left"> <ul> <li><a href="fode.php" target="kasp"><p>Fode</p></a></li> <li><a href="sg.php" target="kasp"><p>Sing</p></a></li> <li><a href="bed.php" target="kasp"><p>Bed</p></a></li> <li><a href="orog.php" target="kasp"><p>Orog</p></a></li> <li><a href="/wordpress/" target="kasp"><p>Blog</p></a></li> <li><a href="tilannce.php" target="kasp"><p>Til annoer</p></a></li> <li><A href="takt.php" target="kasp"><p>takt</p></a></li> </ul> </div> <DIV style="position:absolute;center:0px;top:165px;width:100%;height:100%;z-index:1" align="left"><TABLE width="100%" height="100%" border="0" cellpadding="0" cellspacing="1"><TR><TD align="left" valign="top" width="100%" height="40"><FONT style="font-size:16px" color="#000000" face="Arial"><B><hr></B></FONT></TD></TR></TABLE></DIV> <iframe width="100%" id="the_iframe" name="kasp" onLoad="calcHeight();" style="position:absolute;center:1px;top:175px;z-index:1" src="forside.php" scrolling="NO" frameborder="0" height="1"> iframe capable browser is required to view this web site.</iframe> </BODY> </HTML> <?php include 'footer.php'; ?> This is footer.php <hr> <small>Copyright 2008 My Site</small><br> </body> </html> Similar TutorialsHi All, I am a newbie to php and I have this issue. I would appreciate if anyone can help out. I tried a few things but was not able to come up with a solution. From reading few codes and learning from it, I created this function in query.php and am calling this function in uk.php file, but the problem is that it loads and shows the data in table, but then it stops loading page from there on and the footer which is in html code after the place where I am calling this function does not load. I tried removing return false; command, but with that it loads the footer, but it shows the table after the footer. I want the table with data to show in between header and footer. Can you guys let me know what I need to do to achieve that? File Name: query.php
function uk() { $output = ''; $result = db_query("SELECT * FROM lecture where groups='uk'"); if(mysqli_num_rows($result) > 0) { $output .= '<div id="style2" style="overflow-x:auto;"> <table> <tr> <th class="text-center">Date</th> <th class="text-center">Title</th> <th class="text-center">Venue</th> <th class="text-center">Duration</th> <th class="text-center">Size (MB)</th> <th class="text-center">Link</th> </tr>'; while($row = mysqli_fetch_array($result)) { $output .= ' <tr> <td>'.$row["mydate"].'</td> <td>'.$row["title"].'</td> <td>'.$row["venue"].'</td> <td>'.$row["duration"].'</td> <td>'.$row["size"].'</td> <td><a href="../'.$row["path"].$row["file_name"].'">Save</a></td> </tr> '; } echo $output; } else { echo 'Data Not Found'; } }
File Name: uk.php
Header html code here Some body text <?php include '../includes/query.php'; uk(); return false; ?> Footer html code here
my footer renders ontop... weird huh? tested in chrome & firefox any idea how to fix? footer.php <?php $footer = '<div id="footer" >Copyright © 2011 davidknag.com<br/>Part of the <a href="http://www.davidknag.com/">David Knag Network</a></div>' ?> style.css a { text-decoration:none; color:#888888; } a:hover { color:#999999; text-decoration:underline; } #footer { margin-left:60%; color:#666666; } body { background-color:#191919; color:#FFFFFF; } #box { color:#000000; position: fixed; top: 200px; left: 32%; width:550px; background:#afc8de; padding:2em 0 2em 0; border:solid 10px #1f1f1f; } form{width:500px; margin:0 auto 0 auto;} fieldset {border:none; padding:0 0 2em 0; } #boxfix{width:500px; margin:0 auto 0 auto;} fieldset {border:none; padding:0 0 2em 0; } index.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Todo</title> <link rel="stylesheet" href="style.css" type="text/css" media="screen" charset="utf-8"/> </head> <body> <?php error_reporting(0); require "mysql.php"; $today = getdate(); if ($_POST['logout']) { setcookie("loggedin", "0", time()-3600); } else { } if ($_COOKIE["loggedin"] == 1) { ?> hi! <br/> <form autocomplete="off" action="logout.php" method="POST"> <input value="Log Out" class="logout" type="submit" name="logout"> </form> <?php } else{ $usere = $_POST['user']; $pwe = $_POST['password']; if ($_POST['login']){ $qry="SELECT * FROM users WHERE username='$usere' AND password='$pwe'"; $result=mysql_query($qry); if(mysql_num_rows($result)>0) { echo "<div id='box'><div id='boxfix'>Login Correct! <br/> 1 Second...</div></div>"; $expire=time()+60*60*24*30; setcookie("loggedin", "1", $expire); header('Location: index.php'); } else { echo "<div id='box'><div id='boxfix'><strong>Login Incorrect!</strong><br/>Your Username or Password was Incorrect!</div></div>"; } }else{ ?> <div id="box"> <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST"> User:<br/><input type="text" name="user"><i>*</i><br/> Password:<br/><input type="password" name="password"><i>*</i><br/> <input value="Login" class="submit" type="submit" name="login"> </form> </div> <?php include "footer.php"; echo $footer; ?> <?php } } ?> </body> <head> <html> I am trying to implement a sticky footer on my site, but I cannot get it to work. I've done it on about 5 sites prior to this, but this one is just not working.
The footer sticks to the bottom of the window, not the bottom of the document. I need it to be the bottom of the document.
This is the current state of the page: http://www.aspyrhosting.com/index.php
HTML:
<!DOCTYPE html> <html lang="en-US"> <head> <title></title> <meta charset="utf-8" /> <meta content="index, follow" name="robots" /> <meta content="0.0.1" name="revision" /> <link href="http://cdn2.aspyr.us/imgs/aspyrhosting/favicon.ico?v=0.0.1" rel="shortcut icon" /> <link href="http://cdn2.aspyr.us/css/aspyrhosting/style.css?v=0.0.1" rel="stylesheet" type="text/css" /> </head> <body> <div id="container"> <header role="banner"> <section id="wrapper"> <div id="logoWrapper"> <img id="logo" src="./transparent.png?v=0.0.1" /> </div> <div id="headerRight"></div> </section> <section id="menuWrapper"> <div id="menuInnerWrapper"> <div id="menu"> </div> </div> <div id="searchbox"> Search: <input type="text" /> </div> </section> </header> <main id="content" role="main"> <p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p> </main> <footer> <section id="left"> <div id="copyright" role="copyright"></div> </section> <section id="right"> </section> </footer> </div> </body> </html>CSS: article, aside, figure, footer, header, hgroup, main, menu, nav, section{display: block;} html,body { margin:0; padding:0; height:100%; } #container { height:100%; min-height:100%; min-width: 1115px; position:relative; } header { } #logo { background: url('http://cdn2.aspyr.us/imgs/aspyrhosting/logo.png'); } main { padding-bottom: 100px; /* Height of the footer */ } footer { position:absolute; bottom:0; width:100%; height: 100px; /* Height of the footer */ background:#39f; } #menuWrapper { background: #080000; clear: both; width: 100%; height: 40px; } #menuInnerWrapper { float: left; width: 850px; } #menu { margin: 0 auto; width: 710px; } ul{ padding: 0 3px; margin: 0 auto; list-style-type: none; display: block; float: left; } ul li{ display: inline-block; padding: 0 5px; margin: 0 auto; text-align: center; height: 40px; width: 90px; line-height: 40px; } ul li a { text-decoration: none; color: #fff; } #searchbox { float: right; line-height: 40px; padding-right: 10px; min-width: 200px; width: 10%; } I have written a page that works perfectly on showing the data I need in question. The problem is my footer is showing up as my header... I don't know why. Can someone explain? I put it at the end of the page, after all the php code, and it seems to me it should be inserted there, but for some reason it shows on the top. If anyone can help it be greatly appreciated. Here is the page: http://kaboomlabs.com/testbed/print.php?id=1 Here is the code: Code: [Select] <?php require_once('tb/connectvars.php'); echo '<div id="printwrap">' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>PDI NCMR - Print</title> <link rel="stylesheet" type="text/css" href="tb/postie.css" /> </head> <body> <div id="logo"> <img src="tb/PDI_Logo_2.1.gif" alt="PDI Logo" /> </div> <?php // Connect to the database $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); // Grab the profile data from the database if (!isset($_GET['id'])) { $query = "SELECT * FROM ncmr WHERE id = '$id'"; } else { $query = "SELECT * FROM ncmr WHERE id = '" . $_GET['id'] . "'"; } $data = mysqli_query($dbc, $query); if (mysqli_num_rows($data) == 1) { // The user row was found so display the user data $row = mysqli_fetch_array($data); echo'<div id="title"><h3 id="NCMR2">Non-Conforming Materials Report (NCMR: ' . $row['rma'] . ')</h3></div>'; echo '<form id="all">'; echo '<fieldset>'; //Part, Rev, Part Description, NCMR Qty echo '<div id="box1p">'; if (empty($row['ab'])) $row['ab'] = "Empty"; if (empty($row['date'])) $row['date'] = "Empty"; if (empty($row['part'])) $row['part'] = "Empty"; if (empty($row['rev'])) $row['rev'] = "Empty"; if (empty($row['partdesc'])) $row['partdesc'] = "Empty"; if (empty($row['ncmrqty'])) $row['ncmrqty'] = "Empty"; echo '<div id="abp"><span class="b">Added By: </span>' . $row['ab'] . '</div>'; echo '<div id="datep"><span class="b">Date Filed: </span>' . $row['date'] . '</div>'; echo '<div id="partp"><span class="b">Part Number: </span>' . $row['part'] . '</div>'; echo '<div id="revp"><span class="b">Part Revision: </span>' . $row['rev'] . '</div>'; echo '<div id="partdescp"><span class="b">Part Description: </span>' . $row['partdesc'] . '</div>'; echo '<div id="ncmrqtyp"><span class="b">NCMR Qty: </span>' . $row['ncmrqty'] . '</div>'; echo '</div>'; //Part, Rev, Part Description, NCMR Qty, JO, SN and INV echo '<div id="box2p">'; if (empty($row['comp'])) $row['comp'] = "Empty"; if (empty($row['ncmrid'])) $row['ncmrid'] = "Empty"; if (empty($row['rma'])) $row['rma'] = "Empty"; if (!empty($row['NCMR_Qty'])) $row['NCMR_Qty'] = "Empty"; echo '<div id="comp"><span class="b">Company: </span>' . $row['comp'] . '</div>'; echo '<div id="ncmrid"><span class="b">Customer NCMR ID: </span>' . $row['ncmrid'] . '</div>'; echo '<div id="rma"><span class="b">Internal RMA: </span>' . $row['rma'] . '</div>'; echo '<div id="jno"><span class="b">Job #: </span>' . $row['jno'] . '</div>'; echo '</div>'; //Inventory On Hand, Inventory Check, Supplier Name, Supplier Number, Manufacturer Part Number, Manufactuer Serial Number and NCMR ID echo '<div id="box3p">'; if (empty($row['fdt'])) $row['fdt'] = "Empty"; if (empty($row['cof'])) $row['cof'] = "Empty"; echo '<h2>Failures</h2>'; echo '<div id="fdt"><span class="b">Failure Due To: </span><br />' . $row['fdt'] . '</div>'; echo '<div id="cof"><span class="b">Class of Failu </span><br />' . $row['cof'] . '</div>'; echo '</div>'; //Nonconformity, Disposition, Comments and Comments & Additional Details echo '<div id="box4p">'; if (empty($row['fab1'])) $row['fab1'] = "Empty"; if (empty($row['fab2'])) $row['Disposition'] = "Empty"; if (empty($row['fab3'])) $row['Comments'] = "Empty"; echo '<h2>Fabricators</h2>'; echo '<div id="fab1"><span class="b"></span>' . $row['fab1'] . '</div>'; echo '<div id="fab2"><span class="b"></span>' . $row['fab2'] . '</div>'; echo '<div id="fab3"><span class="b"></span>' . $row['fab3'] . '</div>'; echo '</div>'; //PO, PO Date, and Date Recieved echo '<div id="box5p">'; if (empty($row['non'])) $row['non'] ="Empty"; if (empty($row['dis'])) $row['dis'] ="Empty"; if (empty($row['comm'])) $row['comm'] ="Empty"; if (empty($row['caad'])) $row['caad'] ="Empty"; echo '<div id="non"><span class="b">Nonconformity: <br /></span>' . $row['non'] . '</div><br /><br />'; echo '<div id="dis"><span class="b">Disposition: <br /></span>' . $row['dis'] . '</div><br /><br />'; echo '<div id="comm"><span class="b">Comments: <br /></span>' . $row['comm'] . '</div><br /><br />'; echo '<div id="caad"><span class="b">Comments and/or Additional Details: <br /></span>' . $row['caad'] . '</div>'; //PO, PO Date, and Date Recieved echo '<div id="podrp">'; if (empty($row['po'])) $row['po'] ="Empty"; if (empty($row['pod'])) $row['pod'] ="Empty"; if (empty($row['dri'])) $row['dri'] ="Empty"; echo '<div id="pop"><span class="b">PO: </span>' . $row['po'] . '</div>'; echo '<div id="podp"><span class="b">PO Date: </span>' . $row['pod'] . '</div>'; echo '<div id="drip"><span class="b">Date Recieved: </span>' . $row['dri'] . '</div>'; echo '</div>'; echo '</div>'; echo '<div id="box6p">'; //NCMR Supplier Response & Comment if not empty if (empty($row['ncmrsr'])) $row['ncmrsr'] ="Empty"; if (empty($row['ncmrsc'])) $row['ncmrsc'] ="Empty"; echo '<div id="ncmrsr"><span class="b">NCMR Supplier Response:</span><br />' . $row['ncmrsr'] . '</div><br /><br />'; echo '<div id="ncmrsc"><span class="b">NCMR Supplier Comment:</span><br />' . $row['ncmrsc'] . '</div><br /><br />'; echo '</div>'; echo '</fieldset>'; echo '</div>'; echo '</form>'; } mysqli_close($dbc); echo '</div>'; require_once('tb/pfooter.php'); ?> </body> </html> I have just installed a new theme for my site at JamesGeddes.com however I want to edit the php footer file This, however, is coded in base64; fine for browsers, not so great for people! The file is at http://jamesgeddes.com/wp-content/themes/techno/footer.php but so that you can look at it I have copied the contents to a text file http://jamesgeddes.com/wp-content/themes/techno/txt/footer.txt How can I turn this base64 nonsense in to normal PHP code? Thanks for your help! James Hi all, I have PDF file online i want to edit dynamic footer and page no. at the end of page. Can anyone help me ? thanks in Advance. Manoj Hey, I have a downloaded theme which appears to have hidden spam link in the footer somewhere, but I'm having a hard time locating the source. Here is the site: www.yourvancouvermortgagebroker.ca At the very bottom of the source, you can see: Code: [Select] <script type='text/javascript' src='http://www.yourvancouvermortgagebroker.ca/wp-content/plugins/contact-form-7/jquery.form.js?ver=2.47'></script> <script type='text/javascript' src='http://www.yourvancouvermortgagebroker.ca/wp-content/plugins/contact-form-7/scripts.js?ver=2.4.2'></script> <a href ="http://wp2blog.com"><img src="http://www.yourvancouvermortgagebroker.ca/wp-content/themes/Minimal/images/blank.gif" height="1" width="1" /></a> </body> </html> I've tried de-activating the plugins and it's still there (so it's not a plugin). I've also changed themes and it disappears, so it's only this theme. Here is functions.php: Code: [Select] <?php require_once(TEMPLATEPATH . '/epanel/custom_functions.php'); require_once(TEMPLATEPATH . '/includes/functions/comments.php'); require_once(TEMPLATEPATH . '/includes/functions/sidebars.php'); load_theme_textdomain('Minimal',get_template_directory().'/lang'); require_once(TEMPLATEPATH . '/epanel/options_minimal.php'); require_once(TEMPLATEPATH . '/epanel/core_functions.php'); require_once(TEMPLATEPATH . '/epanel/post_thumbnails_minimal.php'); $wp_ver = substr($GLOBALS['wp_version'],0,3); if ($wp_ver >= 2.8) include(TEMPLATEPATH . '/includes/widgets.php'); ?> and footer.php: Code: [Select] <div id="footer" > <div id="footer-content"> <ul id="bottom-menu"> <?php global $is_footer, $page_menu, $category_menu; $is_footer = true; elegant_init(); if (get_option('minimal_home_link') == 'on') { ?> <li <?php if (is_front_page()) echo('class="current_page_item"') ?>><a href="<?php bloginfo('url'); ?>"><?php _e('Home','Minimal'); ?></a></li> <?php }; ?> <?php if ($category_menu <> '<li>No categories</li>') echo($category_menu); ?> <?php echo $page_menu; ?> </ul> <!-- end ul#bottom-menu --> </div> <!-- end #footer-content --> </div> <!-- end #footer --> </div> <!-- end #page-wrap --> <?php include(TEMPLATEPATH . '/includes/scripts.php'); ?> <?php wp_footer(); ?> </body> </html> Where should I look from here? The link switches every once and a while if that's relevant. I've tried a full text search of all the files for the actual link and it never shows up. Thanks I've finished designing my website home page and I've now moved on the some of the other pages, I want my header and footer to appear the same on every page. I've tried this basic way of linking the same stylesheet that makes up my header/footer in the second HTML file (already used in the homepage):
<link rel="stylesheet" href="footer.css" type="text/css"/> <link rel="stylesheet" href="header.css" type="text/css"/> I now understand that this isn't going to work. Would a server-side scripting language be my best bet here? Something like PHP? If so, would anyone be able to link me with an article on how I could do this in PHP, I presume with the include function? I've had answers elsewhere but this, for me, isn't working: "You are currently only linking the css for the header and footer. If you want to include the html as the same, create two separate files header.php and footer.php, then include them into each webpage. <?php include('path/to/header.php');?> // in the location you want the header in the page <?php include('path/to/footer.php');?> // in the location you want the footer Essentially, you're making partials and placing them wherever you want them" Any help would be greatly appreciated. Edited by Coplestone, 15 January 2015 - 11:52 AM. Simplified for everyone's sanity and re-posted.
Got a Wordpress Conference theme, lets you enter speakers into a database and assign each one a category/role. In the settings for the theme, there's a dropdown from which you can select one of the roles you create. Doing so will display all the speakers assigned that role in the footer of the homepage and also populate a stand-alone Speakers page with the same role. I want to make it so that the footer on the homepage displays one role and the stand-alone speaker page displays another. Here's the PHP for the Speakers page (identical to the footer PHP) <?php Here's the HTML for the "dropdown" portion of the settings, where you can see the role categories available. "Speaker" is the default created by the Theme, "whyattend" is the one I made. <!-- Speakers Category --> I want "whyattend" to show on the Footer and "Speaker" to populate the Speakers page. Can this be done? Hi
I want to get my <footer> to appear at the bottom of my page, but I dont want it to be fixed there.
So if the middle contents of a page is very short, the <footer> will be visibled at the bottom of the browser, but if the page contents is long, then the <footer> would just disappear at the bottom of the contents.
Can this be done?
Thanks
Dear All, Hope all are fine. Need one hep to align the logo in the center of the footer. I tried align = Center but didn't help, please see below code ad advise. <div class="image"> <img src="images/icon/logo.jpg" alt="John Doe"/> </div>
Kind Regards, Naveed. Edited August 2, 2020 by Naveed786I have implemented this slider http://kgperazim.com/test/film2 , however I'd like my header and footer to stay on screen whenever I'm scrolling horizontally.
What would be the best solution to do that with css?
Thx for any advice.
Hi all,
Wondered if anyone could assist?
On the following website the footer is not displaying as expected and cannot see why:
http://www.urxltd.com/index.php
Any other pages on the website show the footer correctly.
Thanks.
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /home/myritebook/public_html/footer.php on line 13 I am trying to fix the above error. Please Help. code is given below:
<?php
if ($conn) {
try{
catch(Exception $e){ |