PHP - Need Help To Align The Logo In Center Of Footer
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 Naveed786Similar 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
How would I get a logo to appear within my search page? I have this png file it is called the following:
wvb-logo-slogen.png
the png file is located under the /mnt/www/html directory.
Here is the code that I am trying to use to get this logo to be displayed on my web page:
<?php if (!isset($_POST['q'])) { ?> <!-- begin logo --> <div id="logo"> <a href="home"><img src="/mnt/www/html/wvb-logo-slogen.png" border="0" /></a> </div> <!-- end logo --> <h2>Search</h2> <form method="post" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>"> <input type="text" name="q" size="30" /> </form> <?php } else { ?> <h2>Search Results</h2> <?php try { // create object // $swish = new Swish('/usr/local/apache/htdocs/swish/index.swish-e'); $swish = new Swish('/var/www/html/pdf2/index.swish-e'); // get and run query from command-line $queryStr = htmlentities($_POST['q']); $result = $swish->query($queryStr); ?> Found <?php echo $result->hits; ?> match(es) for '<?php echo $queryStr; ?>' . <?php // iterate over result set // print details for each match while($r = $result->nextResult()) { ?> <p> <?php echo $r->swishreccount; ?> <strong> <a href="<?php echo '/pdf2', ltrim($r->swishdocpath, '.') ; ?>"> <?php echo $r->swishdocpath; ?> </a> </strong> (sco <?php echo $r->swishrank; ?>) <br/> <?php echo $r->swishdocpath; ?> </p> <?php } } catch (Exception $e) { die('ERROR: ' . $e->getMessage()); } } ?> </body> </html> My questions are the following: Why isn't my logo displaying? Is it the right format? Are there special html or php items that I need to put in order for my logo to be displayed right above the word "Search"? Any assistance would truly be appreciated because I have no experience using php. I posted yesterday and wasnt very clear or the question was way to broad... here is my issue condensed and hoping someone can help me... I am using a sports component and mods in Joomla 1.5 --- that displays a standings table with game results- next game... i am trying to drop/add the team logo next to the team name in the table/s... this is the code from the team page echoing the logo and putting it next to the team name--- see bottom where i have it spaced out.... as you can expect it isn't working of course Code: [Select] <?php if ($this->params->get('team_logo') == 1 && $this->team->logo) { ?> <!-- team logo --> <div style="display: inline; float: left; padding-left: 2px;"> <img src="<?php echo JURI::base() . $this->params->get('images_path') . $this->team->logo;?>" alt="<?php echo stripslashes($this->team->name);?>" title="<?php echo stripslashes($this->team->name);?>" border="1" /><br /> <br /> </div> <!-- team logo --> <?php } ?> and here is the code from the standings module: i highlighted where in the table the logo would be called... i understand broad question here; but, was hoping someone could help me out with this... Code: [Select] <?php /** * @version $Id: mod_gridiron_win_loss.php, v1.5.0 March 2011 01:32:15 * @author Fastball Productions * @package Gridiron * @copyright Copyright (C) 2011 Fastball Productions * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ // no direct access defined('_JEXEC') or die('Restricted access'); $db =& JFactory::getDBO(); // get the module parameters $heading = $params->get( 'heading', '' ); $seasonid = $params->get( 'seasonid', '1' ); $gametypes = $params->get( 'gametypes', '1' ); $teamids = $params->get( 'teamids', '' ); $leagueids = $params->get( 'leagueids', '' ); $divisionids = $params->get( 'divisionids', '0' ); $wheading = $params->get( 'wheading', 'Wins' ); $lheading = $params->get( 'lheading', 'Losses' ); $winpctheading = $params->get( 'pctheading', 'Winning Percentage' ); $gamesplayedheading = $params->get( 'gpheading', 'Games Played' ); $pointsforheading = $params->get( 'pfheading', 'Points For' ); $pointsagainstheading = $params->get( 'paheading', 'Points Against' ); $theading = $params->get( 'theading', 'Ties' ); $showties = $params->get( 'showties', 0 ); if (is_array($gametypes)) { $gametypes = implode(',', $gametypes); } if (is_array($teamids)) { $teamids = implode(',', $teamids); } if (is_array($leagueids)) { $leagueids = implode(',', $leagueids); } if (is_array($divisionids)) { $divisionids = implode(',', $divisionids); } // win/loss/ties variables; $wins = 0; $losses = 0; $ties = 0; // if there are team ids, division ids, or league ids configured, get all of the divisions to separate them; if ($teamids || $divisionids || $leagueids) { if ($teamids) { //$db->setQuery("SELECT d.id, d.division FROM #__fastball_division AS d LEFT JOIN #__fastball_team AS t ON d.id = t.divisionid WHERE (t.published = 1 AND t.divisionid IS NOT NULL AND FIND_IN_SET(t.id, '{$teamids}')) GROUP BY d.id ORDER BY d.division"); $divisions[] = -1; } else if ($divisionids) { //$db->setQuery("SELECT d.id, d.division FROM #__fastball_division AS d LEFT JOIN #__fastball_team AS t ON d.id = t.divisionid WHERE (t.published = 1 AND t.divisionid IS NOT NULL AND FIND_IN_SET(d.id, '{$divisionids}')) GROUP BY d.id ORDER BY d.division"); $db->setQuery("SELECT d.id, d.division FROM #__gridiron_division AS d LEFT JOIN #__gridiron_team AS t ON d.id = t.divisionid LEFT JOIN #__gridiron_schedule AS s ON (t.id = s.visitingteam OR t.id = s.hometeam) WHERE (t.published = 1 AND t.divisionid IS NOT NULL AND FIND_IN_SET(d.id, '{$divisionids}') AND s.season = {$seasonid} AND FIND_IN_SET(s.gametype, '$gametypes')) GROUP BY d.id ORDER BY d.division"); $divisions = $db->loadObjectList(); } else { $db->setQuery("SELECT d.id, d.division FROM #__gridiron_division AS d LEFT JOIN #__gridiron_team AS t ON d.id = t.divisionid LEFT JOIN #__gridiron_schedule AS s ON (t.id = s.visitingteam OR t.id = s.hometeam) WHERE (t.published = 1 AND t.divisionid IS NOT NULL AND FIND_IN_SET(d.leagueid, '{$leagueids}') AND s.season = {$seasonid} AND FIND_IN_SET(s.gametype, '$gametypes')) GROUP BY d.id ORDER BY d.division"); $divisions = $db->loadObjectList(); } } if (!function_exists('getStandingsTeamsModule')) { function getStandingsTeamsModule($divisionid, $seasonid, $teamids, $gametypes) { $db =& JFactory::getDBO(); $seasonid = intval($seasonid); $divisionid = intval($divisionid); if ($teamids) { $db->setQuery("SELECT a.id AS value, a.name AS text FROM #__gridiron_team AS a LEFT JOIN #__gridiron_schedule AS s ON (a.id = s.visitingteam OR a.id = s.hometeam) WHERE (a.published = 1 AND FIND_IN_SET(a.id, '$teamids') AND FIND_IN_SET(s.gametype, '$gametypes') AND s.season = {$seasonid}) ORDER BY a.name"); } else { $db->setQuery("SELECT a.id AS value, a.name AS text FROM #__gridiron_team AS a LEFT JOIN #__gridiron_schedule AS s ON (a.id = s.visitingteam OR a.id = s.hometeam) WHERE (a.published = 1 AND a.defaultteam = 1 AND a.divisionid = {$divisionid} AND FIND_IN_SET(s.gametype, '$gametypes') AND s.season = {$seasonid}) ORDER BY a.name"); } $teamlist = $db->loadObjectList(); /* array to store the wins, losses, ties, and teamid; */ $gamedata = array(); /* go through each teams schedule and get their wins, losses, and ties so that we know how to order the league standings; */ foreach ($teamlist as $team) { $wins = $losses = $ties = $gamesplayed = 0; /* now get the total points for each team and each game; */ $db->setQuery("SELECT s.hometeam, s.visitingteam, b.finalv, b.finalh FROM #__gridiron_schedule AS s LEFT JOIN #__gridiron_boxscore AS b ON b.gameid = s.id WHERE (s.scored = 1 AND s.season = {$seasonid} AND (s.visitingteam = {$team->value} OR s.hometeam = {$team->value}))"); $games = $db->loadObjectList(); /* go through each game and count the wins/losses/ties for the team then dump the results into an array for sorting; */ foreach ($games as $game) { $gamesplayed++; if ($game->hometeam == $team->value) { if ($game->finalh > $game->finalv) { $wins++; } else if ($game->finalh < $game->finalv) { $losses++; } else { $ties++; } } else { if ($game->finalv > $game->finalh) { $wins++; } else if ($game->finalv < $game->finalh) { $losses++; } else { $ties++; } } } /* calculate winning percentage; */ $winpct = $wins + ($ties*.5); if ($gamesplayed > 0) { $winpct = $winpct/$gamesplayed; } else { $winpct = 0; } $winpct = number_format($winpct, 3); $gamedata[] = array('winpct' => $winpct, 'wins' => $wins, 'losses' => $losses, 'ties' => $ties, 'teamid' => $team->value); } /* sort the gamedata array by winpct, wins, losses, ties; */ $winpct = $wins = $losses = $ties = array(); foreach ($gamedata as $key => $value) { $winpct[$key] = $value['winpct']; $wins[$key] = $value['wins']; $losses[$key] = $value['losses']; $ties[$key] = $value['ties']; } array_multisort($winpct, SORT_DESC, $wins, SORT_DESC, $losses, SORT_ASC, $ties, SORT_ASC, $gamedata); $teamsort = array(); foreach ($gamedata as $game) { $teamsort[] = $game['teamid']; } /* teamsort will be used to order the database results so that the team with the best record is on top; */ $teamsort = implode(',', $teamsort); if ($teamids) { $db->setQuery("SELECT t.* FROM #__gridiron_team AS t WHERE (t.published = 1 AND FIND_IN_SET(t.id, '$teamids')) ORDER BY FIND_IN_SET(id, '$teamsort')"); } else { $db->setQuery("SELECT t.* FROM #__gridiron_team AS t WHERE (t.published = 1 AND t.defaultteam = 1 AND t.divisionid = {$divisionid}) ORDER BY FIND_IN_SET(id, '$teamsort')"); } $teams = $db->loadObjectList(); return $teams; } } if (!function_exists('getStandingsStatsModule')) { function getStandingsStatsModule($teams, $seasonid, $gametypes) { $db =& JFactory::getDBO(); $i = 0; $standings = array(); /* go through each team and get their wins, losses, and ties; */ foreach ($teams as $team) { $wins = $losses = $ties = $gamesplayed = $pointsfor = $pointsagainst = 0; /* now get the total points for each team and each game; */ $db->setQuery("SELECT s.hometeam, s.visitingteam, b.finalv, b.finalh FROM #__gridiron_schedule AS s LEFT JOIN #__gridiron_boxscore AS b ON b.gameid = s.id WHERE (s.scored = 1 AND s.season = {$seasonid} AND (s.visitingteam = {$team->id} OR s.hometeam = {$team->id}))"); $games = $db->loadObjectList(); /* go through each game and count the wins/losses/ties for the team then dump the results into an array for sorting; */ foreach ($games as $game) { $gamesplayed++; if ($game->hometeam == $team->id) { $pointsfor = $pointsfor + $game->finalh; $pointsagainst = $pointsagainst + $game->finalv; if ($game->finalh > $game->finalv) { $wins++; } else if ($game->finalh < $game->finalv) { $losses++; } else { $ties++; } } else { $pointsfor = $pointsfor + $game->finalv; $pointsagainst = $pointsagainst + $game->finalh; if ($game->finalv > $game->finalh) { $wins++; } else if ($game->finalv < $game->finalh) { $losses++; } else { $ties++; } } } /* create an object with the team stats to return in the array; */ $obj = new stdClass(); $obj->id = $team->id; $obj->name = stripslashes($team->name); $obj->leagueid = $team->leagueid; $obj->gamesplayed = $gamesplayed; $obj->wins = $wins; $obj->losses = $losses; $obj->ties = $ties; $obj->pointsfor = $pointsfor; $obj->pointsagainst = $pointsagainst; $obj->winpct = $wins + ($ties*.5); if ($obj->gamesplayed > 0) { $obj->winpct = $obj->winpct/$gamesplayed; } else { $obj->winpct = 0; } $standings[] = $obj; $i++; } return $standings; } } ?> <?php if ($teamids || $divisionids || $leagueids) { ?> <table width="100%" border="0" align="center"> <tr> <td colspan="4" style="text-align:center;font-size:18px;"><b><?php echo $heading;?></b></td> </tr> <?php foreach ($divisions as $did) { ?> <tr> <td style="text-align:center; width:4px; "></td> <td bgcolor="#990000" style="text-align:left; width: 200px; border-bottom: 0px #000 solid; color: #FFF;"><b>Team</b></td> <td bgcolor="#990000" style="text-align:center; width:20px; border-bottom: 0px #000 solid; color:#FFF;"><b><?php echo $wheading;?></b></td> <td bgcolor="#990000" style="text-align:center; width:20px; border-bottom: 0px #000 solid; color:#FFF;"><b><?php echo $lheading;?></b></td> <td bgcolor="#990000" style="text-align:center; width:50px; border-bottom: 0px #000 solid; color: #FFF;"><b>Pct.</b></td> <td bgcolor="#990000" style="text-align:center; width:30px; border-bottom: 0px #000 solid; color: #FFF;"><b>GP</b></td> <td bgcolor="#990000" style="text-align:center; width:30px; border-bottom: 0px #000 solid; color: #FFF;"><b>PF</b></td> <td bgcolor="#990000" style="text-align:center; width:30px; border-bottom: 0px #000 solid; color: #FFF;"><b>PA</b></td> <td style="text-align:center; width:4px; "></td> <?php if ($showties) { ?> <td style="text-align:center; width:25px;"><b><?php echo $theading;?></b></td> <?php } ?> </tr> <?php $teams = getStandingsTeamsModule($did->id, $seasonid, $teamids, $gametypes);?> <?php $statdata = getStandingsStatsModule($teams, $seasonid, $gametypes); ?> <?php foreach ($statdata as $stats) { ?> <?php $stats->shortname == '' ? $name = $stats->name:$name = $stats->shortname;?> <tr> [color=purple][i][b]<td style="text-align:center; width:4px;"></td>[/b][/i][/color] <td style="text-align:left; width: 200px; font-size: 12px;"><a href="<?php echo JRoute::_("index.php?option=com_gridiron&view=team&id=$stats->id");?>"><?php echo $name;?></a></td> <td style="text-align:center; width:20px;"><?php echo $stats->wins ? $stats->wins:0;?></td> <td style="text-align:center; width:20px;"><?php echo $stats->losses ? $stats->losses:0;?></td> <td style="text-align:center; width:50px;"><?php echo number_format($stats->winpct, 3)?></b></td> <td style="text-align:center; width:30px;"><?php echo $stats->gamesplayed;?></td> <td style="text-align:center; width:30px;"><?php echo $stats->pointsfor;?></td> <td style="text-align:center; width:30px;"><?php echo $stats->pointsagainst;?></td> <td style="text-align:center; width:4px;"></td> <?php if ($showties) { ?> <td style="text-align:center; width:25px;"><?php echo $stats->ties ? $stats->ties:0;?></td> <?php } ?> </tr> <?php } ?> <tr><td colspan="4"></td></tr> <?php } ?> </table> <?php } ?> thanks trey (Trying to get my brain back into this old problem which I fixed but want to re-code a better way...) So I was having problems with getting some browser error when people would go to checkout because the page logo was coming from an HTTP source and the page was an HTTPS page. I created a "config" file and had this code... Code: [Select] <?php define('ENVIRONMENT', 'development'); //define('ENVIRONMENT', 'production'); // Secure Web Server Root define('SECURE_WEB_ROOT', ENVIRONMENT === 'development' ? 'http://local.dev3/' : 'https://www.mysite.com/'); ?> Then in my page I had... Code: [Select] <div id="header"> <a href="<?php echo WEB_ROOT ?>index.php"> <img id="logo" src="<?php echo SECURE_WEB_ROOT ?>images/mylogo_200x50.png" width="200" alt="My Logo" /> </a> </div> Is there a better way to do this and eliminate my Config file which is no longer needed since I learned how to create a "Virtual Server"? Debbie Hi Guys, I'm going to try and watermark my uploaded images with a small logo (placed onto the original image) so they are all watermarked, is there any tutorials anyone can recommend to do this? i can't seem to find any online. thanks for any help guys Graham Hi Folks, This is my first post here and I was wondering if anyone could help me out at all please. I would basically like to change the logo on the home page based on whether a query string from a referring URL has a specific value. It's an affiliate URL for an online store, so essentially I need to get the referrer, check if the query string adnetwork = as and then replace the logo if it does, if not leave it as it is. Does that make sense? Any help would very much appreciated. I was thinking along the lines of: <?php if ($_GET('adnetwork') == 'as') { changeLogo(); } else { leaveLogo(); } ?> Am I along the right lines folks? 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> Hi! I have this code <?php /** * @Project: Virtual Airlines Manager (VAM) * @Author: Alejandro Garcia * @Web http://virtualairlinesmanager.net * Copyright (c) 2013 - 2016 Alejandro Garcia * VAM is licensed under the following license: * Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) * View license.txt in the root, or visit http://creativecommons.org/licenses/by-nc-sa/4.0/ */ ?> <!DOCTYPE html> <html> <head> <script src="https://maps.googleapis.com/maps/api/js?key=XXX&callback=initMap" type="text/javascript"> </script> <meta http-equiv="refresh" content="300"> </head> <body> <?php include('./db_login.php'); $db_map = new mysqli($db_host , $db_username , $db_password , $db_database); $db_map->set_charset("utf8"); if ($db_map->connect_errno > 0) { die('Unable to connect to database [' . $db_map->connect_error . ']'); } $sql_map = "select plane_type,ias,flight_id,u.gvauser_id as gvauser_id,u.callsign as callsign,u.name as name,gs,altitude,surname,departure,arrival,latitude,longitude,flight_status,heading,perc_completed, pending_nm, a1.latitude_deg as dep_lat, a1.longitude_deg as dep_lon , a2.latitude_deg as arr_lat, a2.longitude_deg as arr_lon , network from vam_live_flights lf, gvausers u , airports a1, airports a2 where u.gvauser_id=lf.gvauser_id and lf.departure=a1.ident and lf.arrival=a2.ident"; if (!$result = $db_map->query($sql_map)) { die('There was an error running the query [' . $db_map->error . ']'); } unset($flights_coordinates); unset($flight); unset($liveflights); unset($datos); unset($jsonarray); $flights_coordinates = array(); $datos = array (); $flight = array(); $liveflights = array (); $jsonarray = array (); $index = 0; $index2=0; $flightindex=0; while ($row = $result->fetch_assoc()) { $flight["gvauser_id"]=$row["gvauser_id"]; $flight["callsign"]=$row["callsign"]; $flight["name"]=$row["name"]; $flight["gs"]=$row["gs"]; $flight["ias"]=$row["ias"]; $flight["altitude"]=$row["altitude"]; $flight["surname"]=$row["surname"]; $flight["departure"]=$row["departure"]; $flight["arrival"]=$row["arrival"]; $flight["latitude"]=$row["latitude"]; $flight["longitude"]=$row["longitude"]; $flight["flight_status"]=$row["flight_status"]; $flight["heading"]=$row["heading"]; $flight["dep_lat"]=$row["dep_lat"]; $flight["dep_lon"]=$row["dep_lon"]; $flight["arr_lat"]=$row["arr_lat"]; $flight["arr_lon"]=$row["arr_lon"]; $flight["perc_completed"]=$row["perc_completed"]; $flight["pending_nm"]=$row["pending_nm"]; $flight["network"]=$row["network"]; $flight["plane_type"]=$row["plane_type"]; $liveflights[$flightindex] =$flight; $sql_map2 = "select * from vam_live_acars where flight_id='".$row["flight_id"]."' order by id asc"; if (!$result2 = $db_map->query($sql_map2)) { die('There was an error running the query [' . $db_map->error . ']'); } while ($row2 = $result2->fetch_assoc()) { $flights_coordinates ["gvauser_id"] = $row2["gvauser_id"]; $flights_coordinates ["latitude"] = $row2["latitude"]; $flights_coordinates ["longitude"] = $row2["longitude"]; $flights_coordinates ["heading"] = $row2["heading"]; $datos [$index2][$index] = $flights_coordinates; $index ++; } $index=0 ; $index2 ++; $flightindex ++; } $jsonarray[0]=$liveflights; $jsonarray[1]=$datos; ?> <div class="container"> <div class="row"> <div id="map-outer" class="col-md-11"> <div id="map-container" class="col-md-12"></div> <div id="over_map"></div> </div><!-- /map-outer --> </div> <!-- /row --> </div><!-- /container --> <style> body { background-color:#FFFFF } #map-outer { padding: 0px; border: 0px solid #CCC; margin-bottom: 0px; background-color:#FFFFF } #map-container { height: 500px } @media all and (max-width: 800px) { #map-outer { height: 650px } } </style> <style> #wrapper { position: relative; } #over_map { position: absolute; top: 50px; left: 10px; z-index: 99; background: white;} </style> </body> <script type="text/javascript"> var mapCentre; var map ; function init_map() { var flights = <?php echo json_encode($jsonarray[0]); ?>; var locations = <?php echo json_encode($jsonarray[1]); ?>; var numpoints=(locations.length); console.log(locations); var var_location = new google.maps.LatLng(<?php echo $datos[0][0]["latitude"]; ?>,<?php echo $datos[0][0]["longitude"]; ?>); var var_mapoptions = { center: var_location, zoom: 5, styles: [{"featureType":"all","elementType":"all","stylers":[{"saturation":"0"},{"lightness":"0"}]},{"featureType":"all","elementType":"geometry","stylers":[{"lightness":"20"}]},{"featureType":"administrative","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"visibility":"on"}]},{"featureType":"administrative","elementType":"labels","stylers":[{"visibility":"on"},{"color":"#716464"},{"weight":"0.01"}]},{"featureType":"administrative.country","elementType":"labels","stylers":[{"visibility":"on"}]},{"featureType":"landscape","elementType":"all","stylers":[{"visibility":"simplified"}]},{"featureType":"landscape.natural","elementType":"geometry","stylers":[{"visibility":"simplified"}]},{"featureType":"landscape.natural.landcover","elementType":"geometry","stylers":[{"visibility":"simplified"}]},{"featureType":"poi","elementType":"all","stylers":[{"visibility":"simplified"}]},{"featureType":"poi","elementType":"geometry.fill","stylers":[{"visibility":"simplified"}]},{"featureType":"poi","elementType":"geometry.stroke","stylers":[{"visibility":"simplified"}]},{"featureType":"poi","elementType":"labels.text","stylers":[{"visibility":"simplified"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"visibility":"simplified"}]},{"featureType":"poi","elementType":"labels.text.stroke","stylers":[{"visibility":"simplified"}]},{"featureType":"poi.attraction","elementType":"geometry","stylers":[{"visibility":"on"}]},{"featureType":"road","elementType":"all","stylers":[{"visibility":"on"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"on"}]},{"featureType":"road.highway","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"visibility":"on"}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#ffad99"},{"lightness":"45"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"visibility":"on"},{"color":"#fbac99"},{"lightness":"1"}]},{"featureType":"road.highway","elementType":"labels","stylers":[{"visibility":"on"}]},{"featureType":"road.highway.controlled_access","elementType":"geometry.fill","stylers":[{"color":"#ffff80"},{"lightness":"50"}]},{"featureType":"road.highway.controlled_access","elementType":"geometry.stroke","stylers":[{"color":"#ff6666"},{"lightness":"59"},{"visibility":"on"},{"weight":"1.10"}]},{"featureType":"road.arterial","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#fff13a"}]},{"featureType":"road.arterial","elementType":"geometry.stroke","stylers":[{"color":"#f2d344"},{"visibility":"off"},{"weight":"1.41"}]},{"featureType":"road.local","elementType":"all","stylers":[{"visibility":"on"}]},{"featureType":"transit","elementType":"all","stylers":[{"visibility":"simplified"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"visibility":"simplified"}]},{"featureType":"transit.station","elementType":"geometry","stylers":[{"visibility":"on"}]},{"featureType":"water","elementType":"all","stylers":[{"visibility":"simplified"},{"color":"#12586f"},{"lightness":"20"},{"gamma":"6.95"},{"saturation":"-29"}]},{"featureType":"water","elementType":"geometry","stylers":[{"visibility":"on"}]},{"featureType":"water","elementType":"geometry.fill","stylers":[{"visibility":"on"}]}] }; map = new google.maps.Map(document.getElementById('map-container'), var_mapoptions); var mapas=[]; var flightPlanCoordinates=[]; var flightPath = new google.maps.Polyline({ strokeColor: "#c3524f", strokeOpacity: 1, strokeWeight: 2, geodesic: true }); var k=0; var z=0; var coordinate; while (k<numpoints) { while (z < locations[k].length) { coordinate =new google.maps.LatLng(locations[k][z]['latitude'],locations[k][z]['longitude']); flightPlanCoordinates.push(coordinate); z=z+1; } ruta = new google.maps.Polyline({ geodesic: true, strokeColor: '#FF0000', strokeOpacity: 1.0, strokeWeight: 2 }); ruta.setPath(flightPlanCoordinates); mapas.push(ruta); z=0; k=k+1; }; function createMarker(pos, t) { var coord=[]; var pathcoord=[]; var flight_id = t; currentPath = new google.maps.Polyline({ geodesic: true, strokeColor: '#FF0000', strokeOpacity: 1.0, strokeWeight: 2 }); // Plane marker begin var image = new google.maps.MarkerImage("./map_icons/"+flights[t]['heading'] +".png",null,new google.maps.Point(0,0),new google.maps.Point(15, 15),new google.maps.Size(30, 30)); var icon_airport = new google.maps.MarkerImage("./map_icons/airport_yellow_marker.png"); var lineSymbol = {path: 'M 0,-1 0,1', strokeOpacity: 1, scale: 1 }; var lat1 = flights[t]["dep_lat"]; var lat2 = flights[t]["arr_lat"]; var lng1 = flights[t]["dep_lon"]; var lng2 = flights[t]["arr_lon"]; var dep = new google.maps.LatLng(lat1, lng1) var arr = new google.maps.LatLng(lat2, lng2) var icon_plane = 'images/plane.png'; var marker = new google.maps.Marker({ position: pos, icon: image, name: t , contenido: flights[t]['callsign']+ ' '+flights[t]['name']+ ' '+flights[t]['surname'] , icao1:new google.maps.Marker({ position: dep, map: map, icon: icon_airport, visible: false }), icao2:new google.maps.Marker({ position: arr, map: map, icon: icon_airport, visible: false }), line1:new google.maps.Polyline({ path: [dep, pos], strokeColor: "#08088A", strokeOpacity: 1, strokeWeight: 2, geodesic: true, map: map, polylineID: t, visible: false }) , line2:new google.maps.Polyline({ path: [pos, arr], strokeColor: "#FE2E2E", strokeOpacity: .3, geodesic: true, map: map, icons: [{ icon: lineSymbol, offset: '0', repeat: '5px' }], polylineID: t, visible: false }) }); // On mouse over google.maps.event.addListener(marker, 'mouseover', function () { //infowindow.open(map, marker); this.get('line1').setVisible(true); this.get('line2').setVisible(true); this.get('icao1').setVisible(true); this.get('icao2').setVisible(true); infowindow.open(map,marker); infowindow.setContent(marker.contenido); var s=0; coord.length = 0; pathcoord.length = 0; while (s < locations[flight_id].length) { coord= new google.maps.LatLng(locations[flight_id][s]['latitude'],locations[flight_id][s]['longitude']); pathcoord.push(coord); s=s+1; } currentPath.setPath(pathcoord); currentPath.setMap(map); }); // On mouse end // mouse out google.maps.event.addListener(marker, 'mouseout', function () { //infowindow.close(); //this.get('line1').setVisible(false); //this.get('line2').setVisible(false); //this.get('icao1').setVisible(false); //this.get('icao2').setVisible(false); //currentPath.setMap(null); }); // mouse out end // On Click begin google.maps.event.addListener(marker, 'click', function() { infowindow.open(map,marker); infowindow.setContent(marker.contenido); var s=0; coord.length = 0; pathcoord.length = 0; while (s < locations[flight_id].length) { coord= new google.maps.LatLng(locations[flight_id][s]['latitude'],locations[flight_id][s]['longitude']); pathcoord.push(coord); s=s+1; } currentPath.setPath(pathcoord); currentPath.setMap(map); if (this.get('line1').visible ='true') { this.get('line1').setVisible(false); } if (this.get('line2').visible ='true') { this.get('line2').setVisible(false); } if (this.get('icao1').visible ='true') { this.get('icao1').setVisible(false); } if (this.get('icao2').visible ='true') { this.get('icao2').setVisible(false); } flight_detail='<div class="panel panel-map">\ <!-- Default panel contents -->\ <div class=\"panel-heading\">'+flights[t]['departure'] + ' <i class="fa fa-arrow-right"></i> ' + flights[t]['arrival']+'</div>\ <table class="table-map">\ <tr>\ <td><small>Flight completed</small><br><div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="\ '+flights[t]['perc_completed'] + '" aria-valuemin="0" aria-valuemax="100" style="width:'+flights[t]['perc_completed']+'%">\ '+flights[t]['perc_completed'] + ' %</div></td>\ </tr>\ <tr>\ <td><small>Callsign</small><br><strong>\ '+flights[t]['callsign'] + '</strong></td>\ </tr>\ <tr>\ <td><small>Flight Status</small><br><strong>\ '+flights[t]['flight_status'] + '</strong></td>\ </tr>\ <tr>\ <td><small>Plane Type</small><br><strong>\ '+flights[t]['plane_type'] + '</strong></td>\ </tr>\ <tr>\ <td><small>Network</small><br><strong>\ '+flights[t]['network'] + '</strong></td>\ </tr>\ <tr>\ <td><small>Pending NM</small><br><strong>\ '+flights[t]['pending_nm'] + '</strong></td>\ </tr>\ <tr>\ <td><small>GS</small><br><strong>\ '+flights[t]['gs'] + '</strong></td>\ </tr>\ <tr>\ <td><small>IAS</small><br><strong>\ '+flights[t]['ias'] + '</strong></td>\ </tr>\ <tr>\ <td><small>Altitude</small><br><strong>\ '+flights[t]['altitude'] + '</strong></td>\ </tr>\ <tr>\ <td><small>Heading</small><br><strong>\ '+flights[t]['heading'] + '</strong></td>\ </tr>\ </table>\ </div>'; //flights[t]['departure'] + '-' + flights[t]['arrival'] + '<br />' + flights[t]['callsign']+ ' '+flights[t]['name']+ ' '+flights[t]['surname'] + '<br />' + 'ALTITUDE: ' + flights[t]['altitude'] + '<br />' + 'GS: ' + flights[t]['gs']+ '<br />' + 'HEADING: ' + flights[t]['heading'] + '<br />' + flights[t]['flight_status']; $('#over_map').html("<div id='mySecondDiv'>"+flight_detail+"</div>"); }); // On Click end return marker; } var numflight=0 while (numflight < flights.length ) { var avionicon =new google.maps.LatLng(flights[numflight]['latitude'],flights[numflight]['longitude']); var m1 = createMarker(avionicon, numflight); m1.setMap(map); numflight = numflight +1; } var s=0; while (s < mapas.length) { s=s+1; } var infowindow = new google.maps.InfoWindow({ }); google.maps.event.addListener(infowindow, 'closeclick', function() { $('#over_map').html(""); }); } google.maps.event.addDomListener(window, 'load', init_map); $( document ).ready(refreshflights); function refreshflights(){ setInterval(function () {$.ajax({ url: 'get_map_coordinates.php', data: "", dataType: 'json', success: function(data, textStatus, jqXHR) { init_map(); } })}, 120000); } </script> </html> I need map to be centered on marker every time i go on my webpage. Right now is centered on deparrture aiport. So this is map for flights, as flight is ongoing , aircraft (marker) on route, map should be tracking it so every time i refresh my wepage, map should point to marker, not to departure airport. Can anyone halp me. Thank you Edited December 23, 2020 by mrshiljoI 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%; } 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> Hey guys, I am having trouble centering a navbar with css on my template.
Here is a jsfiddle live preview for you.
http://jsfiddle.net/LRS38/
I added text-align:center; to it but it still wont center. I also added a margin:0 auto; but no luck.
Can anyone see what I am doing wrong?
<div id="navigation"> <ul> <li><a href="#">Home</a></li> <li><a href="#">About</a></li> <li class="current"><a href="#">Services</a></li> <li><a href="#">Contact us</a></li> </ul> </div>and #navigation { text-align:center; background-color:#ef6b51; overflow:hidden; } Hi, I have the code below: <? /* * search.php * * Script for searching a datbase populated with keywords by the * populate.php-script. */ print "<html><head><title>[Squashy] Search! NOT MESSED UP.</title></head><body>\n"; if( $_POST['keyword'] ) { /* Connect to the database: */ mysql_pconnect("www.freesqldatabase.com","sql01_44052","censored") or die("ERROR: Could not connect to database!"); mysql_select_db("sql01_4405hahamo1"); /* Get timestamp before executing the query: */ $start_time = getmicrotime(); /* Execute the query that performs the actual search in the DB: */ $query = ' SELECT p.page_url AS url, COUNT(*) AS occurrences FROM page p, word w, occurrence o WHERE p.page_id = o.page_id AND w.word_id = o.word_id AND (false '; $words = explode(' ', $_POST['keyword']); foreach ($words as $word) { $query .= 'OR w.word_word = "' . $word . '" '; } $query .= ') GROUP BY p.page_id ORDER BY occurrences DESC LIMIT ' . $_POST['results']; $result = mysql_query($query); /* Get timestamp when the query is finished: */ $end_time = getmicrotime(); /* Present the search-results: */ print "<h2>[Squashy] Search Results For '".$_POST['keyword']."':</h2>\n"; for( $i = 1; $row = mysql_fetch_array($result) or die(mysql_error()); $i++ ) { print "$i. <a href='".$row['url']."'>".$row['url']."</a>\n"; print "(occurrences: ".$row['occurrences'].")<br><br>\n"; } /* Present how long it took the execute the query: */ print "This search took: ".(substr($end_time-$start_time,0,5))." seconds."; } else { /* If no keyword is defined, present the search-page instead: */ print "<form method='post'>[Squashy Search] <input type='text' size='20' name='keyword'>\n"; print "Results: <select name='results'><option value='5'>5</option>\n"; print "<option value='10'>10</option><option value='15'>15</option>\n"; print "<option value='20'>20</option></select>\n"; print "<input type='submit' value='Search [Squashy]'></form>\n"; } print "</body></html>\n"; /* Simple function for retrieving the currenct timestamp in microseconds: */ function getmicrotime() { list($usec, $sec) = explode(" ",microtime()); return ((float)$usec + (float)$sec); } ?> How do I: a) Center the search box and title and add an image above it like in google, the code for the search box and title is (taken from the code above) { /* If no keyword is defined, present the search-page instead: */ print "<form method='post'>[Squashy Search] <input type='text' size='20' name='keyword'>\n"; print "Results: <select name='results'><option value='5'>5</option>\n"; print "<option value='10'>10</option><option value='15'>15</option>\n"; print "<option value='20'>20</option></select>\n"; print "<input type='submit' value='Search [Squashy]'></form>\n"; } b) How do I protect the code so that people can't see the database name and password? Thanks, Will I tried to code this, but failed miserably. What I wanted was a admin page that contained various stats of a football match. TEAM 1....................TEAM 2 0...........Score...........0 0.......Shots on target.......0 0.......Shots off target.......0 ect, ect.... The first way I layed it out was a table, i entered the data and it saved to a text file, which then displayed on stats.php in a table format. That then displayed elsewhere via an iframe. I was wondering if someone would code me a stats center like I've explained! You could even help me do it, I don't mind....As long as I get it! 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 Hi :-) How can I align digit as you can see in the screen shot.
<?php function MaFonction($x){ for ($i=0 ; $i<=360 ; $i+=$x){ echo $i . " ==> " . deg2rad($i) . "<br />"; } } ?> <?php MaFonction(15 ); ?>
Thank you ;-) 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 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? 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. |