\n");
include("../header.shtml");
// Check the input
// We expect a $berichtID=YYYY-MM-DD as parameters
if(!isset($_GET['berichtID'])){
die ('
Please specify a date when invoking this script.');
}
else {
$berichtID=$_GET['berichtID'];
}
if (ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $berichtID, $regs)) {
$datum="$regs[1]$regs[2]$regs[3]";
} else {
die ('
Invalid date format. Check the URL or contact the webmaster if this problem persists.');
}
// Print the page title
printf("
News from $berichtID
\n\n");
// Define the variables
// frederik.gotdns.org:1976 db
$dbserver="localhost";
$usernaam="webnews";
$paswoord="BlaBla123";
$database="website";
$tabel="newsContent";
// vanrenterghem.biz db
//$dbserver="localhost";
//$usernaam="frederik_fred";
//$paswoord="fred";
//$database="frederik_News";
//$tabel="newsContent";
// -- Table structure for table 'newsContent'
// --
//
// CREATE TABLE newsContent (
// title varchar(40) default NULL,
// date date default NULL,
// body text
// )
// Connect to database
$db=mysql_connect($dbserver,$usernaam,$paswoord) or die ("Geen connectie met server");
mysql_select_db($database,$db) or die ("Database bestaat niet");
$resultatenreeks=mysql_query("SELECT * FROM $tabel WHERE date=$datum") or die ('An error occured while retrieving data from the database. Please contact the webmaster if this problem persists.');
while ($resultatenrij = mysql_fetch_row($resultatenreeks)) {
// Put the results in a table, one table per result
printf("\n");
printf("
%s
|
%s | |
%s
|
\n\n",
$resultatenrij[0], $resultatenrij[1], $resultatenrij[2]);
}
// Print the footer
printf("\n");
include("../footer.php");
?>