Note that there are some explanatory texts on larger screens.

plurals
  1. POAfter submit form my footer changes position PHP MYSQL
    text
    copied!<p>I've been having a really annoying "error"... My page have a header, left sidebar and a footer. After i submit the form everything goes really good EXCEPT now the footer is in the middle of the page!! I tried everything i knew to and searched but i still can't solve that.</p> <p>BEFORE SUBMIT with footer on the right place : <a href="http://i48.tinypic.com/ly1dl.jpg" rel="nofollow">http://i48.tinypic.com/ly1dl.jpg</a> <br /> AFTER SUBMIT with footer on the middle of the page : <a href="http://i47.tinypic.com/168a3uq.jpg" rel="nofollow">http://i47.tinypic.com/168a3uq.jpg</a></p> <p>Here is The code :</p> <p>Header:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;link href="stylesheets/stylesheet.css" type="text/css" rel="stylesheet" /&gt; &lt;title&gt;Wilson Electric &amp; Alarm Company&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="header"&gt; &lt;h1 id="toptitle"&gt; Wilson Electric &amp; Alarm Company &lt;/h1&gt; &lt;/div&gt; &lt;div id="navigation_top"&gt; &lt;/div&gt; &lt;div id="column_left"&gt; &lt;ul id="left_menu"&gt; &lt;li&gt; &lt;a href="testing2.php"&gt; Insert Page &lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href="search.php"&gt; Search Page &lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href=""&gt; Menu 4 &lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href=""&gt; Menu 5 &lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href=""&gt; Menu 6 &lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href="user.php"&gt; User &lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href="admin.php"&gt; Admin &lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href="login.php"&gt; Login &lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href="create_username.php"&gt; Create Username &lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div id="content"&gt; </code></pre> <p>Footer : </p> <pre><code>&lt;/div&gt; &lt;div id="footer"&gt; This is a Footer. &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Stylesheet : (there is also a default reset in my stylesheet before the #container) </p> <pre><code>#container { width:100%; height:100%; } #header { width: 100%; height:120px; } #column_left { float:left; width:15%; height:100%; border-right: 3px solid #06F; border-left: 3px solid #06F; } #content { width:100%; height:100%; } #footer { width:100%; height: 30px; border-top:3px solid #06F; } #navigation_top { width:100%; height:15px; border-bottom:3PX solid #06F; } #toptitle { padding:30px; font-size:300%; font-weight:700; } .formtitle { font-weight:800; font-size:150%; } #form { margin-left:230px; padding-top:30px; } table,th, td { border: 1px solid black; } table { width:1024px; } th { font-weight:800; background-color:#0FF; } </code></pre> <p>And here is the page code that is giving me those problems!! </p> <pre><code>&lt;?php require_once("includes/connection.php"); ?&gt; &lt;?php require_once("includes/functions.php"); ?&gt; &lt;?php if (isset($_POST['search'])) { $date1 = mysql_prep($_POST['date1']); $date2 = mysql_prep($_POST['date2']); $latte = mysql_prep($_POST['latte']); $coffee = mysql_prep($_POST['paid']); $query = "SELECT * FROM payroll WHERE (day BETWEEN '{$date1}' AND '{$date2}') AND (company = '{$latte}') AND (paid = '{$coffee}') ORDER BY day ASC "; $result = mysql_query($query, $connection); $woof = "SELECT SUM(p.hours) AS sum_hours , COUNT(DISTINCT p.day) AS cnt_days FROM PAYROLL p WHERE p.day BETWEEN '{$date1}' AND '{$date2}' AND company = '{$latte}' AND paid = '{$coffee}' "; $raw = mysql_query($woof, $connection); if(!$raw) { die(mysql_error());} $meow = mysql_result($raw, 0, 0); $days = mysql_result($raw, 0, 1); if(!$result) { echo "FAIL"; } else { $message = "&lt;table&gt; &lt;tr&gt; &lt;th&gt; Date &lt;/th&gt; &lt;th&gt; Hours &lt;/th&gt; &lt;th&gt; Job Title &lt;/th&gt; &lt;th&gt; Job Description &lt;/th&gt; &lt;th&gt; For &lt;/th&gt; &lt;th&gt; Paid &lt;/th&gt; &lt;/tr&gt;"; while($row = mysql_fetch_array($result)) { $company = $row['company']; if($company == 0) { $company = "Wilson Electric"; } if($company == 1) { $company = "Wilson Rental"; } if ($company == 2) { $company = "Church of Christ"; } $paid = $row['paid']; if($paid == 0) { $paid = "Yes"; } else { $paid = "&lt;form action=\"update.php\" method=\"post\" &gt;&lt;input type=\"checkbox\" name=\"paid\" value=\"0\"&gt; NO "; } $message .= "&lt;tr&gt;"; $message .= "&lt;td class=\"center\"&gt;" . $row['day'] . "&lt;/td&gt;"; $message .= "&lt;td class=\"center\"&gt;" . $row['hours'] . "&lt;/td&gt;"; $message .= "&lt;td style=\"padding:5px;\"&gt;" . $row['job_title'] . "&lt;/td&gt;"; $message .= "&lt;td style=\"padding:5px;\"&gt;" . $row['job_description'] . "&lt;/td&gt;"; $message .= "&lt;td style=\"padding:5px;\"&gt;" . $company . "&lt;/td&gt;"; $message .= "&lt;td class=\"center\"&gt;" . $paid . "&lt;/td&gt;"; $message .= "&lt;/tr&gt;"; } $message .= "&lt;tr&gt;"; $message .= "&lt;td class=\"center\"&gt; Total Days: " . $days . "&lt;/td&gt;"; $message .= "&lt;td class=\"center\"&gt; Total Hours: " . $meow . "&lt;/td&gt;"; $message .= "&lt;td class=\"center\"&gt; &amp;nbsp; &lt;/td&gt;"; $message .= "&lt;td class=\"center\"&gt; &amp;nbsp; &lt;/td&gt;"; $message .= "&lt;td class=\"center\"&gt; &amp;nbsp; &lt;/td&gt;"; $message .= "&lt;td class=\"center\"&gt; &lt;input type=\"submit\" name=\"gamind\" value=\"Update\"&gt; &lt;/form&gt; &lt;/td&gt;"; $message .= "&lt;/tr&gt;"; } } ?&gt; &lt;?php include("includes/header.php"); ?&gt; &lt;form action="" method="post" id="form"&gt; &lt;h1 class="formtitle"&gt; Search &lt;/h1&gt; &lt;br /&gt; &lt;table id="table1"&gt; &lt;th&gt; From &lt;/th&gt; &lt;th&gt; To &lt;/th&gt; &lt;th&gt; For &lt;/th&gt; &lt;th&gt; Paid &lt;/th&gt; &lt;tr&gt; &lt;td&gt; &lt;input type="date" name="date1" value="" &gt; &lt;/td&gt; &lt;td&gt; &lt;input type="date" name="date2" value="" &gt; &lt;/td&gt; &lt;td&gt; &lt;select name="latte" &gt; &lt;option value="0"&gt; Wilson Electric &lt;/option&gt; &lt;option value="1"&gt; Wilson Rental &lt;/option&gt; &lt;option value="2"&gt; Church of Christ&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;td&gt; &lt;input type="radio" name="paid" value="0"&gt; Yes &lt;br /&gt; &lt;input type="radio" name="paid" value="1"&gt; No &lt;br /&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="4" align="right"&gt; &lt;input type="submit" name="search" value="Search"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;br /&gt; &lt;br /&gt; &lt;p&gt; &lt;?php if(!empty($message)) { echo "&lt;h1 class=\"formtitle\"&gt; Payroll Result &lt;/h1&gt;"; echo $message; } ?&gt; &lt;/p&gt; &lt;/form&gt; &lt;?php include("includes/footer.php"); ?&gt; &lt;?php mysql_close($connection); ?&gt; </code></pre> <p>Sorry for the loooong post!! I hope someone knows the solution for my problem!</p> <p>Thanks! :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload