\n"); include("../header.shtml"); // Check the input // We expect a $berichtID=YYYY-MM-DD as parameters if(!isset($berichtID)){die ('
Please specify a date when invoking this script.');} 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 $dbserver="localhost"; $usernaam="frederik"; $paswoord="Fred1210"; $database="website"; $tabel="newsContent"; $maxShown=5; // -- 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("
cornerul %s cornerur %s
%s

\n\n", $resultatenrij[0], $resultatenrij[1], $resultatenrij[2]); } // Print the footer printf("\n"); include("../footer.php"); ?>