diff --git a/content.php b/content.php new file mode 100644 index 0000000..37d8534 --- /dev/null +++ b/content.php @@ -0,0 +1,35 @@ +name = $name; + $this->filename = $filename; + } + + public function createPage() + { + include ("{$contentFolder}{$this->filename}.html"); + } + + public function createMenuItem() + { + // Match just the name, without the .html, .php etc parc + preg_match_all("/[a-z_\-0-9]*/i", $this->filename, $out); + $bareFilename = $out[0][0]; + + // Print the menu item + print ("
+This is my blog about everything and nothing, please enjoy! +
diff --git a/content/contact.html b/content/contact.html new file mode 100644 index 0000000..bc99cbf --- /dev/null +++ b/content/contact.html @@ -0,0 +1,6 @@ ++Please feel free to contact me at name@example.tld +
+ + diff --git a/includes/dbconnect.php b/includes/dbconnect.php index c79d11d..f1b9d5f 100644 --- a/includes/dbconnect.php +++ b/includes/dbconnect.php @@ -3,10 +3,10 @@ require "config.php"; // Connect to MySQL database $link = mysql_connect($host, $user, $password) - or die("Could not connect..."); + or terminate("Could not connect..."); mysql_select_db($database) - or die("Could not open database"); + or terminate("Could not open database"); ?> diff --git a/includes/htmlcode.php b/includes/htmlcode.php index f084c18..133e862 100644 --- a/includes/htmlcode.php +++ b/includes/htmlcode.php @@ -15,4 +15,16 @@ function end_html() print "\n\n