Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Footer Displaying in Middle Of Page
Old 12-06-2007, 04:06 PM Footer Displaying in Middle Of Page
melefire's Avatar
Experienced Talker

Posts: 46
Name: matt
Trades: 0
For some reason the footer is displaying before the bale in my page, here is the code:
PHP Code:
<?php
###################################
# File: listandconfirm.php        #
# Project: List Confirm System    #
# By: MeleFire                    #
# Copyright 2007                  #
###################################
// Call Global Config File
include("config.php");
//Call header file
include 'header.php';
// Check for correct url
if (isset($_GET['id'])) {
    
$id=$_GET['id'];
} elseif ( 
$_GET['id'] == "" ) {
 echo 
"No event was selected";
 include 
'footer.php';
 exit;
} else {
 echo 
"No event was selected";
 include 
'footer.php';
 exit;
}
// Open DataBase Connection
mysql_connect($dbloc,$dbuser,$dbpass);
@
mysql_select_db($dbname) or die( "Unable to select database");
// Set Querys
$sql1 "INSERT INTO `confirmed` (`Name`, `EventID`) VALUES ('$name', '$id');";
// Check for form submit
if (isset($_POST['name'])) {
    
$name=$_POST['name'];
    
mysql_query($sql1);
    echo 
"<b><center>Added $name to event!</center></b>";
}
// Load table of those already confirmed
$table="confirmed";
// sending query
$result mysql_query("SELECT * FROM `$table` WHERE EventID='$id';");
if (!
$result) {
    die(
"Query to show fields from table failed");
}
$fields_num mysql_num_fields($result);
// Check if exists
$sql2="SELECT * FROM `event` WHERE `ID` = '$id';";
$exist mysql_query($sql2);
$num=mysql_num_rows($exist);
$q=0;
if (
$q == $num) {
 echo 
"<center><img src=images/ERROR.png><br />Event Does Not Exist!!<center>";
 include 
'footer.php';
 exit;
}
// Print confirm form
echo <<<END
<center><h3>Sign up for this event</h3>
<form action="listandconfirm.php?id=
$id" method="post">
Name: <input type="text" name="name" />
<input type="submit" />
</form>
END;
// Check if user is first person
$sql5="SELECT * FROM `confirmed` WHERE `EventID` = '$id';";
$first mysql_query($sql5);
$numcheck=mysql_num_rows($first);
if (
$q == $numcheck) {
echo <<<END
<table border="5">
<tr>
<td><img src=images/first.gif></td>
<td>If you register now you will be the first person to do so!</td>
</tr>
</table>
END;
include 
'footer.php';
exit;
}
##################################
## Print List ####################
##################################
echo "<h1>List Of Campouts</h1>";
echo 
"<table border='3'><tr>";
// printing table headers
for($i=0$i<$fields_num$i++)
{
    
$field mysql_fetch_field($result);
    echo 
"<td><b>{$field->name}</b></td>";
}
echo 
"</tr>\n";
// printing table rows
while($row mysql_fetch_row($result))
{
    echo 
"<tr>";
    
// $row is array... foreach( .. ) puts every element
    // of $row to $cell variable
    
foreach($row as $cell)
        echo 
"<td>$cell</td>";
    echo 
"</tr>\n</center>";
}
mysql_free_result($result);
// Display Footer
echo <<<END
</div>
<div id="footer">
<p>www.troop439md.net</p>
<h5>Event Registration System</h5>
</div>
</body>
</html>
END;
?>
melefire is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-06-2007, 04:28 PM Re: Footer Displaying in Middle Of Page
Foundationflash's Avatar
Ultra Talker

Posts: 410
Name: Harry Burt
Location: Colchester, Essex, England
Trades: 0
More likely an html issue rather than the PHP. Link would help in assessing that though.
__________________
Foundation Flash tutorials :
Please login or register to view this content. Registration is FREE


New Dreamed Up Web Design:
Please login or register to view this content. Registration is FREE
Foundationflash is offline
Reply With Quote
View Public Profile Visit Foundationflash's homepage!
 
Old 12-06-2007, 05:41 PM Re: Footer Displaying in Middle Of Page
NullPointer's Avatar
Will Code for Food

Posts: 2,786
Name: Matt
Location: Irvine, CA
Trades: 0
Most likely you are having a CSS problem rather than a PHP problem. Give us a link or your HTML source.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Reply     « Reply to Footer Displaying in Middle Of Page
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12514 seconds with 12 queries