include in div werkt niet (include op zich wel)

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Tom Isenbaert

Tom Isenbaert

10/11/2007 12:53:00
Quote Anchor link
beste,

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>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php include_once ('mededelingen/afwezigheden.php'); ?>




</div>


<div id="rightcol"><div class='afwbigtext'>Informatie</div><hr></div>



<div id="content">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
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"){
            ?>

<td class="topmenu" align="center"><a class="topmenuSelected" href="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo "$topicurl";?>
">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo "$topicnaam";?>
</a></td>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
<?php
            }
    else {
        ?>

<td class="topmenu" align="center"><a class="topmenu" href="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo "$topicurl";?>
">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo "$topicnaam";?>
</a></td>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
<?php
    }
    }

 print "</tr></table>\n";
 
include ('DB/closeconnection.php');
?>

</div>

</body>
</html>


afwezigheden.php


Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
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");
    
?>



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;

}
 
PHP hulp

PHP hulp

05/05/2024 21:29:37
 
Crispijn -

Crispijn -

10/11/2007 13:05:00
Quote Anchor link
Welke database wil je gaan gebruiken? Waar selecteer je de database en maak je verbinding? Ik heb je script niet doorgespit alleen de error spreekt voor zich toch?

Errors vertellen je waar de fout zit, ga stapsgewijs te werk bij het oplossen van deze fouten.
 
Tom Isenbaert

Tom Isenbaert

10/11/2007 14:15:00
Quote Anchor link
ik maak gebruik van mysql db.

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?
 
Tom Isenbaert

Tom Isenbaert

10/11/2007 14:21:00
Quote Anchor link
opgelost...
zat met probleem dat 'k 'n misse url verwees.
zat net 'n mapje te laag.

greetz merci
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.