3 <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-15" />
4 <meta NAME="Author" CONTENT="webmaster@vanrenterghem.biz (Frederik Vanrenterghem)" />
5 <meta NAME="Description" CONTENT="Personal homepage - Blog from Frederik Vanrenterghem" />
6 <title>Frederik Vanrenterghem's Blog</title>
7 <link rel='stylesheet' type='text/css' href='/styles/main.css' />
8 <link rel='stylesheet' type='text/css' href='/styles/newspage.css' />
9 <link rel='stylesheet' type='text/css' href='/styles/header.css' />
14 printf("<!--HEADER-->\n");
15 include("../header.shtml");
18 // We expect a $berichtID=YYYY-MM-DD as parameters
20 if(!isset($_GET['berichtID'])){
21 die ('<BR>Please specify a date when invoking this script.');
24 $berichtID=$_GET['berichtID'];
27 if (ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $berichtID, $regs)) {
28 $datum="$regs[1]$regs[2]$regs[3]";
30 die ('<BR>Invalid date format. Check the URL or <a href="/About/index.shtml">contact the webmaster</a> if this problem persists.');
34 // Print the page title
35 printf("<BR><H1>News from $berichtID</H1>\n\n");
37 // Define the variables
38 // frederik.gotdns.org:1976 db
40 $dbserver="localhost";
42 $paswoord="BlaBla123";
46 // vanrenterghem.biz db
47 //$dbserver="localhost";
48 //$usernaam="frederik_fred";
50 //$database="frederik_News";
51 //$tabel="newsContent";
54 // -- Table structure for table 'newsContent'
57 // CREATE TABLE newsContent (
58 // title varchar(40) default NULL,
59 // date date default NULL,
63 // Connect to database
65 $db=mysql_connect($dbserver,$usernaam,$paswoord) or die ("Geen connectie met server");
66 mysql_select_db($database,$db) or die ("Database bestaat niet");
69 $resultatenreeks=mysql_query("SELECT * FROM $tabel WHERE date=$datum") or die ('An error occured while retrieving data from the database. Please <a href="/About/index.shtml">contact the webmaster</a> if this problem persists.');
72 while ($resultatenrij = mysql_fetch_row($resultatenreeks)) {
74 // Put the results in a table, one table per result
75 printf("<!--NEWSITEM-->\n");
76 printf("<table border='0' cellpadding='0' cellspacing='0' width='100%%' summary=''><tr><td><table bgcolor='#000084' border='0' cellpadding='0' cellspacing='0' width='100%%' summary=''>
77 <tr><td valign='top'><img src='/Pics/newsitem_ul.png' align='left' border='0' hspace='0' vspace='0' alt='cornerul' width='16' height='16'><font color=white><B>
79 </td><td align='right' valign='top'><img src='/Pics/newsitem_ur.png' align='right' border='0' hspace='0' vspace='0' alt='cornerur' width='16' height='16'><font color=white><B>
80 %s </B></font></td></tr></table></td></tr><tr><td>
81 %s <BR><BR></td></tr></table>\n\n",
82 $resultatenrij[0], $resultatenrij[1], $resultatenrij[2]);
87 printf("<!--FOOTER-->\n");
88 include("../footer.php");