Location: PHPKode > projects > Oriblog > oriblog/post.php

// edit these two lines

// everything below here can be left alone

$title=date("d/m/y"); // this line and the next generate a title which 
// includes the date as a handy reference
$title=$title." - ".$_POST["title"];
// the next few lines do the fiddling required to make sure the data 
// looks right, whether it's viewed via the RSS feed or via the database
$longpost=str_replace("<br />", "\n", $post);
$shortpost=str_replace("<br />", "\n", $shortpost);
if ($pass == $password) {
	include "db.inc";
	// this line actually inserts the data
	mysql_query("INSERT INTO entries VALUES (NULL, '$title', '$post')");
	$getid=mysql_query("SELECT id FROM entries WHERE title='$title'");
	// from here on in, we're building the RSS feed.
	$arrFp = file("rss/feed.xml");
	$lines = count($arrFp);
	$insertat = $lines-2;
	for ($i=0; $i<$insertat; $i++) {
	if (strlen($shortpost)<strlen($longpost)) {
	$fp=fopen("rss/feed.xml", "w");
	fwrite( $fp, $rsstext );
	echo "Post successfully submitted!";
} else {
	echo "You are not authorised to post to this server!";
Return current item: Oriblog