PHP - How To Keep My Header And Footer On Screen When Scrolling Horizontally.
I 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.
Similar TutorialsI 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'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. Hi 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
This sounds stupid, i know. I want to create a foreach loop that will display 3 records per row. For example when you go on play.com and you query something you get a tile view of items. Can anyone help me? Hi, sincerely hope i can get some help here. im pulling some images from my database but i want to display them horizontally for example 3 or 4 images in a row then it moves to a new row. so far i have only being able to display the images vertically. I am not sure if i should be using css or there is a way to do it with php. would appreciate any assistance. I have been tryin to get this done for sometime now and i need to complete this project. I'm new at this I'm realitivly new to PHP and was hoping somebody could help. I have a mysql database that stores information about books. I am currently using the code below to query the database and extract the 3 most recent entries and showing them in a dynamic list: Code: [Select] $sql = mysql_query("SELECT * FROM products ORDER BY date_added DESC LIMIT 3"); $productCount = mysql_num_rows($sql); if ($productCount > 0) { // ensure a book exists while($row = mysql_fetch_array($sql)){ $id = $row["id"]; $title = $row["title"]; $author = $row["author"]; $price = $row["price"]; $date_added = strftime("%b %d, %Y", strtotime($row["date_added"])); $dynamiclist .= //My table showing the products } } else { $dynamicList = "There are currently no Books listed in this store"; } This works well when showing the most recent books 1 below the other. However, I would like to show these products side by side, horizontally across the page. Can somebody please point me in the right direction? Many thanks Hi Guys! Trying to display data in 3 rows horizontally and 25 vertiacally Code: [Select] // Print out result while($row = mysql_fetch_array($result)){ echo "There are ". $row['COUNT(biddersId)'] ." bidders logged."; echo "<br />"; } $query = "SELECT * FROM bidders ORDER BY biddersId"; $result = mysql_query($query) or die(mysql_error()); echo "<table border='1'>"; echo "<tr> <th>Bidders</th>"; // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table echo "<tr><td>"; echo"<font face= \"calibri\" size=\"3\">"; echo $row['biddersId']; echo "</br>"; echo "</td><td>"; } echo "</table>"; ?> I´ve reached to
<?php require_once('Connections/conexxion.php'); ?> <?php mysql_select_db($database_conexxion, $conexxion); $query_consulta = "SELECT venta,compra,taller,regula_mas,regula_menos,movimiento.id_item,sum(compra+regula_mas-venta-taller-regula_menos) as stock, cilindro, esfera FROM movimiento join item on item.id_item=movimiento.id_item join rx on rx.id_rx=item.id_rx join cilindro on cilindro.id_cil=rx.id_cil join esfera on esfera.id_esf=rx.id_esf GROUP BY movimiento.id_item ORDER BY esfera desc, cilindro desc"; $consulta = mysql_query($query_consulta, $conexxion) or die(mysql_error()); $row_consulta = mysql_fetch_assoc($consulta); $totalRows_consulta = mysql_num_rows($consulta); ?> <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>test</title> </head> <body> <?php echo "<table align=center>"; $columnes = 10; # Número de columnas (variable) if (($rows=mysql_num_rows($consulta))==0) { echo "<tr><td colspan=$columnes>No hay resultados en la BD.</td></tr> "; } else { echo "<tr><td colspan=$columnes>$rows Resultados </td></tr>"; } for ($i=1; $row = mysql_fetch_row ($consulta); $i++) { $resto = ($i % $columnes); # Número de celda del <tr> en que nos encontramos if ($resto == 1) {echo "<tr>";} # Si es la primera celda, abrimos <tr> echo "<td>$row[1]</td>"; if ($resto == 0) {echo "</tr>";} # Si es la última celda, cerramos </tr> } if ($resto <> 0) { # Si el resultado no es múltiple de $columnes acabamos de rellenar los huecos $ajust = $columnes - $resto; # Número de huecos necesarios for ($j = 0; $j < $ajust; $j++) {echo "<td> </td>";} echo "</tr>"; # Cerramos la última línea </tr> } mysql_close($connexion); echo "</table>"; ?> </body> </html> <?php mysql_free_result($consulta); ?>it "works", but results doesn´t start at number 1 but number 2 anyways, The intent of this table is to show the stock of a product, a lens, that has a range of Rx, we use to see this range this way, and show the stock this way would be very productive, but I can´t figure out how to achive it, any sugestion?? Edited by gralfitox, 16 December 2014 - 06:45 AM. I have a vertically and horizontally centered image within a window. The layout as is perfect. The only issue is that when the window is resized, the image is clipped by the browser window. I wanted the image to remain 100% within the scroll bars of the window, so the page can be scrolled, so you can access any part of the image with the scroll bars.
Development URL: http://www.tinasguitar.com/develop/
(Resize the window and you'll see what I mean.
CSS and HTML follow:
article, aside, figure, footer, header, hgroup, main, menu, nav, section{display: block;} body{ padding: 0; margin: 0; margin: 0 auto; text-align: center; background-color: #dcdcdc; } #wrapper { top: 50%; left: 50%; margin-top: -333px; /* Half the height */ ; /* Half the width */ position: absolute; } #bgImage { width: 960px; height: 667px; background: url("http://www.tinasguitar.com/bg.jpg"); } #socialBar { position: absolute; top: 80px; left: 100px; } #socialBar img { width: 33px; height: 33px; background-image: url("http://www.tinasguitar.com/social.png"); background-repeat: no-repeat; margin-left: 10px; } #twitter { background-position: -34px 0px; } #fb { background-position: -102px 0px; } #yt { background-position: -68px 0px; } #gp { background-position: 0px 0px; } <!DOCTYPE html> <html lang="en-US"> <head> <base href="http://www.tinasguitar.com/" /> <title>Tina S.</title> <meta charset="utf-8" /> <meta content="" name="keywords" /> <meta content="" name="description" /> <meta content="index, follow" name="robots" /> <link href="/develop/style.css" rel="stylesheet" type="text/css" /> </head> <body> <section id="wrapper"> <img src="transparent.png" id="bgImage" name="bgImage" usemap="#vigierguitars"> <div id="note">This is an unofficial fan site that links to Tina's official social networking pages. The owner of this site has no affiliation with Tina.</div> <div id="socialBar"> <a href="https://twitter.com/Tina_S__"><img alt="Twitter" id="twitter" name="twitter" src="transparent.png" title="Twitter" /></a> <a href="https://www.facebook.com/pages/Tina-S/181555232026760"><img alt="FaceBook" id="fb" name="fb" src="transparent.png" title="FaceBook" /></a> <a href="https://plus.google.com/+TinaS"><img alt="Google+" id="gp" name="gp" src="transparent.png" title="Google+" /></a> <a href="https://www.youtube.com/user/malabar777"><img alt="YouTube" id="yt" name="yt" src="transparent.png" title="YouTube" /></a> </div> </section> <map name="vigierguitars"> <area shape="rect" coords="700,520,865,620" href="http://www.vigierguitars.com/" alt="Vigier Guitars" target="_blank"> </body> </html>Basically I need to some how create a hard border that the browser window observes as the definitive borders of the page, so the browser window can't clip off portions of the image. Hello everyone, I'm just starting out with PHP as I need to create an online bookstore for a school project. I'm working by a magazine which should teach you exactly how to do this using PHP, but I've had a bunch of problems with the code they use and I don't really know what's going on. Anyway, this looks really simple and basically what it does is allows you to post a comment on a book, then returns you to the book's page. Problem is, I'm getting the Header may not contain more than a single header, new line detected. error and I can't figure out why. I've tried researching into the matter but all the cases I found had to do with returning to an url, which is not my case. Anyway, here's the snippet of code: The form: Code: [Select] <div style="width:400px; border:1px solid #ffffff; background-color:#F9F1E7; padding:5px"> <b>Adauga opinia ta:</b> <hr size="1"> <form action="adauga_comentariu.php" method="POST"> Nume: <input type="text" name="nume_utilizator"><br><br> Email: <input type="text" name="adresa_email"><br><br> Comentariu: <br> <textarea name="comentariu" cols="45"></textarea><br><br> <input type="hidden" name="id_carte" value="<?=id_carte?>"> <center><input type="submit" value="Adauga"</center> </form> </div> The script adaugare_comentariu.php: Code: [Select] <?php ob_start(); include("conectare.php"); $numeFaraTags=strip_tags($_POST['nume_utilizator']); $emailFaraTags=strip_tags($_POST['adresa_email']); $comentariuFaraTags=strip_tags($_POST['comentariu']); $sql="insert into comentarii (id_carte, nume_utilizator, adresa_email, comentariu) values(".$_POST['id_carte'].", '".$numeFaraTags."','".$emailFaraTags."','".$comentariuFaraTags."')"; mysql_query($sql); $inapoi="carte.php?id_carte=".$_POST['id_carte']; header("location:urldecode($inapoi)"); ob_end_flush(); ?> conectare.php connects to the mysql database. $inapoi is the variable which returns the user to carte.php (the book he posted a comment on), where id_carte is the book's unique id. I'm getting Header may not contain more than a single header, new line detected on line ten, which is the header line. Can anyone help me? I've been stumped on this for a few days now and I've just let it pass and started working on other bits, but it's bugging me too much and I'd like to fix it. This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=350027.0 Hi, I want this output for an XML doc I create via DOM functions. <?xml version="1.0" ?> <letter> <to> <toFirstContact>Bob</toFirstContact> </to> </letter> BUT it outputs nothing to browser screen! Please see code below: Code: [Select] <?php //TEST for REPEAT APPENDAGE $aDoc=new DOMDocument(); $root=$aDoc->createElement("letter"); //create child elem to append to root elem node $newChild1=$aDoc->createElement("to"); //append new child elem <to> to root <letter> $root->appendChild($newChild1); //make elem<toFirstContact> and also create a text, then append to <to> $toFirstContactTag=$aDoc->createElement("toFirstContact"); $textNode1=$aDoc->createTextNode("Bob"); $toFirstContactTag->appendChild($textNode1); //now append new child <toFirstContact> to <to> $newChild1->appendChild($toFirstContactTag); print $aDoc->saveXML(); ?> Any help much appreciated! Hello.
The first page works, but when form actioning to the next i just get a white screen.
This is the white screen page:
<?php session_start(); include 'details.php'; $username = $_POST['username']; $password = $_POST['password']; $pwswdrd = md5($password); if(!empty($_POST['username'])) { $query = mysqli_query($con, "SELECT * FROM users where name = '$username' AND pass = '$pwswdrd'") or die(mysqli_connect_error()); $row = mysqli_fetch_array($query); if(!empty($row['name']) AND !empty($row['pass'])) { $_SESSION['username'] = $row['username']; $_SESSION['id'] = $row['id']; header('Location: index.php'); } } else { echo "You failed to log in."; } ?> - details.php <?php $one=mysqli_connect('.......webhost.com','aee','aaa') or die("Failed to connect to MySQL: " . mysqli_error() ); $db=mysqli_select_db($one,'aee') or die("Failed to connect to MySQL: " . mysqli_error() ); ?> -- What can possibly be wrong?! Hi, I need some basic video capturing features. So I want to ask, is there any way, library or work-round for recording browser screen in a video file using PHP? Thanks in Advance. I have a login screen that only partly works if i put in the password and click submit it gives me a 500 internal server error. but if i put in the wrong password it gives me the wrong password screen. i am new to this and lost as to why it doesn't work any help would be appreciated. i am running on vista with iis7 and mysql. also this is some code i found online and changed it around to fit the new php 5.3.6 so not sure what i did or if i need to change more. Thank you in advance Hi, Im trying to work out a way to get the New York Lottery's Take 5 results. Theres a few sites that list the winning numbers, i assume automatically as there is alot of lottery games on these sites. what would be the best way to get this? http://www.myfreepost.com/lottery/index.php/us/newyorklottery/takefive/result/ http://www.elite-lottery-results.com/?action=view_game&gid=NY2 Ok, I know how to screen scrape, but I don't know how to screen scrape when there is a login. I've looked this up for awhile, but no luck. I'd like to also make it so I can execute a url when I am logged in on the script for the script, for an example execute this url: http://site.com/data.php?id=9912&submit=1 Thanks in advanced. Hello and ty all for helping I have located the problem its in login.php file but dont know where thats why am turning to experts of coding. My file is located here ftp.sofo.si username and password are same "guest" pls feel free to download and inspect Thank you again for any help cheers Good morning all! I'm running this function, but for some reason, it's throwing up a blank white screen. I have no idea why. The "echo $query" doesn't return anything, but those fields are all in the table I'm pulling from, so I don't understand what's going on. Any help would be appreciated! Thanks! function attacks() { $query = doquery("SELECT id, name FROM `attacks` ORDER BY name", "attacks"); echo $query; $page = "<b><u>Edit attacks</u></b><br />Click on a attack name to edit it.<br /><br /><table width=\"50%\">\n"; $count = 1; while ($row = mysql_fetch_array($query)) { if ($count == 1) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"admin_panel.php?do=editattack:".$row["id"]."\">".$row["name"]."</a></td></tr>\n"; $count = 2; } else { $page .= "<tr><td width=\"8%\" style=\"background-color: #ffffff;\">".$row["id"]."</td><td style=\"background-color: #ffffff;\"><a href=\"admin_panel.php?do=editattack:".$row["id"]."\">".$row["name"]."</a></td></tr>\n"; $count = 1; } } if (mysql_num_rows($query) == 0) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">No attacks found.</td></tr>\n"; } $page .= "</table>"; admindisplay($page, "Edit attacks"); } |