Split project into multiple files, added a way to post to the blog and rewrote README file

This commit is contained in:
2013-07-25 06:12:02 +02:00
parent b14dc108c3
commit 36751401ca
6 changed files with 77 additions and 29 deletions

28
user/createpost.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
// Include config file
require "../config.php";
// Connect to MySQL database
$link = mysql_connect($host, $user, $password)
or die("Could not connect...");
mysql_select_db($database)
or die("Could not open database");
$query = "INSERT INTO blog (date, title, posttext) VALUES
('$_POST[date]','$_POST[title]','$_POST[post]')";
if (!mysql_query($query))
{
die ("Something went wrong!");
}
print "Post added";
// Close MySQL link
mysql_close($link);
?>