Ik ben begonnen aan een nieuw project om weer lekker diep php in te duiken en er weer goed van te leren. Maar nu liep ik tegen het volgende probleem aan:
Stel je hebt de layout zo geschreven (denk je):
Header.php
Index.php
Footer.php
Dus bovenaan de header, daaronder de content, en daaronder de footer. Dit heb ik geloof ik ook gedaan. Maar mijn code doet dit:
header.php
footer.php
index.php
Dus hij zet de footer boven de index neer, en dat is niet de bedoeling.
Ik heb hier de code van de index.php:
<?php include('header.php'); ?>
<div class="center">
<table>
<tr>
<td>
<form action="register.php" method="post"></td>
<td>All fields that are marked with a (*) are required!</td>
</tr>
<tr>
<td>First Name</td>
<td class="bright_red" width="5px;">*</td>
<td><input type="text" name="firstname" value="<?php echo"$firstname"; ?>"/></td>
</tr>
<tr>
<td>Middle Name</td>
<td class="bright_red" width="5px;"></td>
<td><input type="text" name="middlename" value="<?php echo"$middlename"; ?>" /></td>
</tr>
<tr>
<td>Last Name</td>
<td class="bright_red" width="5px;">*</td>
<td><input type="text" name="lastname" value="<?php echo"$lastname"; ?>" /></td>
</tr>
<tr>
<td>Country</td>
<td class="bright_red" width="5px;">*</td>
<td><input type="text" name="country" value="<?php echo"$country"; ?>" /></td>
</tr>
<tr>
<td>State</td>
<td class="bright_red" width="5px;">*</td>
<td><input type="text" name="state" value="<?php echo"$state"; ?>" /></td>
</tr>
<tr>
<td>City</td>
<td class="bright_red" width="5px;">*</td>
<td><input type="text" name="city" value="<?php echo"$city"; ?>" /></td>
</tr>
<tr>
<td>Postal/Zip Code</td>
<td class="bright_red" width="5px;">*</td>
<td><input type="text" name="zip" value="<?php echo"$zip"; ?>" /></td>
</tr>
<tr>
<td>Phone</td>
<td class="bright_red" width="5px;">*</td>
<td><input type="text" name="phone" value="<?php echo"$phone"; ?>" /></td>
</tr>
<tr>
<td>Website</td>
<td class="bright_red" width="5px;"></td>
<td><input type="text" name="website" value="<?php echo"$website"; ?>" /></td>
</tr>
<tr>
<td>Youtube</td>
<td class="bright_red" width="5px;"></td>
<td><input type="text" name="youtube" value="<?php echo"$youtube"; ?>" /></td>
</tr>
<tr>
<td>Email Address</td>
<td class="bright_red" width="5px;">*</td>
<td><input type="text" name="email1" value="<?php echo"$email1"; ?>" /></td>
</tr>
<tr>
<td>Confirm Email</td>
<td class="bright_red" width="5px;">*</td>
<td><input type="text" name="email2" /></td>
</tr>
<tr>
<td>Create password</td>
<td class="bright_red" width="5px;">*</td>
<td><input type="password" name="password1" value="<?php echo"$password1"; ?>" /></td>
</tr>
<tr>
<td>Confirm password</td>
<td class="bright_red" width="5px;">*</td>
<td><input type="password" name="password2" /></td>
</tr>
<tr>
<td></td>
<td></td>
<td><input type="submit" name="submit" value="Sign Up" />
</td>
</tr>
</div>
<?php include('footer.php'); ?>
En ik heb natuurlijk de css:
html {background:#E1EBF4 url(images/topbar.png) repeat-x; font-family:"Trebuchet MS",Helvetica,Jamrul,sans-serif; font-size:14px; color:#313F5E;}
body {margin:0;}
.center {margin:0 auto; width:960px;}
#top {height:35px; color:#58688A; padding:10px; text-transform:uppercase; font-weight:bold;}
#top span {color:#F7AC08;}
#final {background:#262C44; min-height:70px; color:#58688A;}
#final div {margin:0 auto; width:920px; padding:20px;}
/*Lettertypes/color*/
.bright_red{color:#F00;}
En om het compleet te maken,
De header:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='nl' lang='nl'>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Even weggehaald</title>
<link rel='stylesheet' href='style.css' type='text/css' media='screen' />
</head>
<body>
<div class='center'>
<div id='top'>
<a href='index.html' title=''>Home</a> | Bel Webbart: <span>06-1234 5678</span>
</div>
</div>
En tot slot de footer:
<div id='final'>
<div>© 2011-2012 Web-bart</div>
</div>
</div>
</body>
</html>
Dus nog 1x het probleem:
De header staat netjes bovenaan de pagina. Maar de footer staat onder de header, en de content staat onder de footer...
Wie weet hoe ik dit weer een beetje logisch kan maken?
Groeten,
B. Roelofs
P.s dit script is nog niet af, maar ik weet niet hoe ik dit probleem kan oplossen. Dit script voert momenteel nog niets uit.