Worked out a class to easily include subpages/content and put the footer in a function
This commit is contained in:
@@ -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");
|
||||
|
||||
|
||||
?>
|
||||
|
@@ -15,4 +15,16 @@ function end_html()
|
||||
print "\n\n</body>\n</html>\n";
|
||||
}
|
||||
|
||||
function footer()
|
||||
{
|
||||
print "
|
||||
</div>
|
||||
<div id=\"footer\">
|
||||
<p>© 2014 - Jack-Benny Persson</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>";
|
||||
}
|
||||
?>
|
||||
|
8
includes/miscfunc.php
Normal file
8
includes/miscfunc.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
function terminate($message="")
|
||||
{
|
||||
print "$message\n";
|
||||
footer();
|
||||
exit(1);
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user