include in div werkt niet (include op zich wel)
Ben bezig met website met div layout.
In het linkerpane van index.php wil ik afwezigheden includen.
afwezigheden.php haalt gegevens op uit db en werkt op zich.
Wanneer ik deze dan in index.php include werkt deze niet en krijg ik errormsg "no db selected"
Iemand een id waar 'k fout zit?
Alvast bedankt. Zie code hieronder:
index.php
<html>
<head>
<title>Stedelijke Academie voor Muziek en Woord - Izegem</title>
<link href="CSS/samwizegem.css" rel="stylesheet">
<link href="CSS/stylesheet.css" rel="stylesheet">
</head>
<body>
<div id="header"><center><img src="IMG/header/header.gif"></center></div>
<div id="leftcol">
<div class='afwbigtext'>Mededelingen</div><hr>
</div>
<div id="rightcol"><div class='afwbigtext'>Informatie</div><hr></div>
<div id="content">
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
include ("DB/connection.php");
$select_maintopics = "SELECT TopicUrl, TopicNaam from menutopics WHERE TopicParent = 'main'";
$result = mysql_query( $select_maintopics )
or die ( 'It Didn\'t Work: ' . mysql_error() );
print "<table border='1' cellpadding='0' cellspacing='0' width='100%'><tr>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$topicurl = $line['TopicUrl'];
$topicnaam = $line['TopicNaam'];
if ($topicnaam == "Home"){
?>
include ("DB/connection.php");
$select_maintopics = "SELECT TopicUrl, TopicNaam from menutopics WHERE TopicParent = 'main'";
$result = mysql_query( $select_maintopics )
or die ( 'It Didn\'t Work: ' . mysql_error() );
print "<table border='1' cellpadding='0' cellspacing='0' width='100%'><tr>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$topicurl = $line['TopicUrl'];
$topicnaam = $line['TopicNaam'];
if ($topicnaam == "Home"){
?>
<td class="topmenu" align="center"><a class="topmenuSelected" href=""></a></td>
<td class="topmenu" align="center"><a class="topmenu" href=""></a></td>
</div>
</body>
</html>
afwezigheden.php
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
include ("../DB/connection.php");
$select_afwezigheden = "SELECT LeerkrachtNaam, LeerkrachtVak, DATE_FORMAT(DatumVan, '%d-%m-%Y') as datumvan, DATE_FORMAT(DatumTot, '%d-%m-%Y') as datumtot from afwezigheden";
$resultafw = mysql_query( $select_afwezigheden )
or die ( 'It Didn\'t Work: ' . mysql_error() );
while ($line = mysql_fetch_array($resultafw, MYSQL_ASSOC)) {
$naam = $line['LeerkrachtNaam'];
$vak = $line['LeerkrachtVak'];
$datumvan = $line['datumvan'];
$datumtot = $line['datumtot'];
echo "$naam".", leerkracht "."$vak"."<br>Van "."$datumvan"."<br>Tot "."$datumtot<br /><br />";
}
include ("../DB/closeconnection.php");
?>
include ("../DB/connection.php");
$select_afwezigheden = "SELECT LeerkrachtNaam, LeerkrachtVak, DATE_FORMAT(DatumVan, '%d-%m-%Y') as datumvan, DATE_FORMAT(DatumTot, '%d-%m-%Y') as datumtot from afwezigheden";
$resultafw = mysql_query( $select_afwezigheden )
or die ( 'It Didn\'t Work: ' . mysql_error() );
while ($line = mysql_fetch_array($resultafw, MYSQL_ASSOC)) {
$naam = $line['LeerkrachtNaam'];
$vak = $line['LeerkrachtVak'];
$datumvan = $line['datumvan'];
$datumtot = $line['datumtot'];
echo "$naam".", leerkracht "."$vak"."<br>Van "."$datumvan"."<br>Tot "."$datumtot<br /><br />";
}
include ("../DB/closeconnection.php");
?>
stylesheet.css
/* CSS Document */
html, body {
margin: 0;
height: 100%;
}
a:link, a:visited, a:active, a:hover{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
text-align:center;
font-weight:bold;
color: #1B2B44;
text-decoration: none;
}
ul.richtingen
{
font-family:Arial, Helvetica, sans-serif;
font-size: 14px;
text-align:left;
font-weight:bold;
color: #1B2B44;
text-decoratioin: none;
padding-left: 50px;
margin-left: 50px;
list-style-type: none;
line-height:24px;
}
ol.richtingen
{
font-family:Arial, Helvetica, sans-serif;
font-size: 12px;
text-align:left;
font-weight:normal;
color: #1B2B44;
text-decoratioin: none;
}
.tablelijn
{
border-left:solid;
border-color:#1B2B44;
border: thick;
}
.maintext
{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
text-align:center;
font-weight:normal;
color: #1B2B44;
text-decoration: none;
line-height: 14px;
padding-left:20px;
margin-left:20px;
}
.afwmaintext
{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
text-align:left;
font-weight:normal;
color: #FFFFFF;
text-decoration: none;
line-height: 14px;
}
.smalltext
{
font-family:Arial, Helvetica, sans-serif;
font-size:10px;
text-align:center;
font-weight:normal;
color: #1B2B44;
text-decoration: none;
line-height: 10px;
}
.afwsmalltext
{
font-family:Arial, Helvetica, sans-serif;
font-size:10px;
text-align:left;
font-weight:normal;
color: #FFFFFF;
text-decoration: none;
line-height: 10px;
}
.bigtext
{
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
text-align:center;
font-weight:bold;
color: #1B2B44;
text-decoration: none;
padding-left:50px;
margin-left:50px;
}
.afwbigtext
{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
text-align:center;
font-weight:normal;
color: #FFFFFF;
text-decoration: none;
}
.titeltext
{
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
text-align:center;
font-weight:bold;
color: #1B2B44;
text-decoration: none;
padding-left:20px;
margin-left:20px;
}
.topmenu
{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
text-align:center;
font-weight:normal;
color: #FFFFFF;
background-color:#1B2B44;
text-decoration: none;
}
td.leftmenu
{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
text-align:center;
font-weight:normal;
color: #00CC00;
background-color:#CCCCCC;
text-decoration: none;
}
A.topmenu
{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
text-align:center;
font-weight:normal;
color: #FFFFFF;
background-color:#1B2B44;
text-decoration: none;
}
A.topmenu:hover
{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
text-align:center;
font-weight:bolder;
color: #FFFFFF;
background-color:#1B2B44;
text-decoration: none;
}
A.topmenuSelected
{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
text-align:center;
font-weight:normal;
color: #A9B84D;
background-color:#1B2B44;
text-decoration: none;
}
.submenu
{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
text-align:center;
font-weight:normal;
color: #1B2B44;
text-decoration: none;
}
A.submenu
{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
text-align:center;
font-weight:normal;
color: #1B2B44;
text-decoration: none;
}
A.submenu:hover
{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
text-align:center;
font-weight:bolder;
color: #1B2B44;
text-decoration: none;
}
A.submenuSelected
{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
text-align:center;
font-weight:normal;
color: #1B2B44;
text-decoration: none;
}
samwizegem.css
body {
margin: 0px;
padding: 0px;
}
#header {
width: 100%;
height: 90px;
background:url(../IMG/header/headerfill.gif);
}
#leftcol {
background: url(../IMG/header/bluefill.gif);
float: left;
width: 20%;
height: 90%;
}
#rightcol {
background: url(../IMG/header/bluefill.gif);
float: right;
width: 20%;
height: 90%;
}
#content {
background: #CCCCCC;
float: left;
width: 60%;
height: 90%;
}
#footer {
background: #0f0;
clear: both;
width: 100%;
height: 5%;
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: normal;
text-align: right;
}
Errors vertellen je waar de fout zit, ga stapsgewijs te werk bij het oplossen van deze fouten.
en 'k maak verbinding via 'n include file waarvan 'k de inhoud niet bijgevoegd had.
En aangezien de includefile afwezigheden.php op zich werkt ligt dit toch niet aan mijn connectie?
zat met probleem dat 'k 'n misse url verwees.
zat net 'n mapje te laag.
greetz merci