Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
is het niet makkelijker via de admin.php.... zodat mensen die toegang willen tot de adminpagina...
function nieuwsberichten($aantal, $categorie) {
//Hoeveel nieuwsberichten wil je hebben? En uit welke categorie?
$aantal = mysql_real_escape_string($aantal);
$categorie = mysql_real_escape_string($categorie);
if(is_numeric($aantal)) {
//Aantal is niet verplicht, categorie ook niet
if(empty($categorie)) {
$query = "SELECT nieuwsID from nieuws ORDER BY nieuwsDatum DESC LIMIT ".$aantal."";
} else {
$query = "SELECT nieuwsID from nieuws WHERE nieuwsCategorie = '".$categorie."' ORDER BY nieuwsDatum DESC LIMIT ".$aantal."";
}
} else {
$query = "SELECT nieuwsID from nieuws ORDER BY nieuwsDatum DESC";
}
$resultaat = mysql_query($query);
if($resultaat) {
$aantal = mysql_num_rows($resultaat);
} else {
$aantal = 0;
}
if($aantal >= 1) {
while($rij = mysql_fetch_array($resultaat)) {
$nieuwsid = $rij['nieuwsID'];
//Nieuwsbericht functie uitvoeren in een loopje voor meerdere berichten.
nieuwsbericht($nieuwsid);
}
} else {
echo 'Sorry, ik heb geen berichten kunnen vinden.';
exit;
}
}
<?php
session_start();
ob_start();
error_reporting(E_ALL);
//Alles includen wat we nodig hebben.
include 'configuratie.php';
include 'inhoud/functies.php';
include 'inhoud/reageren.php';
include 'inhoud/nieuws.php';
include 'inhoud/gebruikers.php';
//Controlleer of iemand ingelogd is of een koekje heeft om dat te regelen.
controlleerinlog();
?>
Warning: mysql_query(): Access denied for user: 'apache@localhost' (Using password: NO) in /home/httpd/vhosts/dedriebiertjes.nl/httpdocs/site/inhoud/voorpagina.php on line 5
Warning: mysql_query(): A link to the server could not be established in /home/httpd/vhosts/dedriebiertjes.nl/httpdocs/site/inhoud/voorpagina.php on line 5
Sorry, er gaat hier iets mis wat eigenlijk niet fout kan gaan...
<?php
session_start();
error_reporting(E_ALL);
//Alles includen wat we nodig hebben.
include 'configuratie.php';
include 'nieuws.php';
$paginaid = 1;
$query = "SELECT content FROM content WHERE paginaid = ".$paginaid."";
$resultaat = mysql_query($query);
if($resultaat && mysql_num_rows($resultaat) == 1) {
$rij = mysql_fetch_array($resultaat);
$content = stripslashes($rij['content']);
echo $content;
} else {
echo '<p>Sorry, er gaat hier iets mis wat eigenlijk niet fout kan gaan...</p><br />';
}
nieuwsberichten('alles', 'categorie');
?>
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.