$f = mysql_pconnect("localhost","lisa","ben$91");
function display_form() {
global $PHP_SELF;
?>
}
function submit_form() {
global $text, $title;
$text = ereg_replace("\n[ ]*\r","",$text);
$text = ereg_replace("\n"," ",$text);
$text = ereg_replace("\r","",$text);
$text = ereg_replace(" +"," ",$text);
$text = ereg_replace(" ","\n\n",$text);
$result = mysql("lisa","INSERT INTO rant (date,title,text) VALUES(CURRENT_DATE, '" . addslashes($title) . "', '" . addslashes($text) . "')")
or die("Bad query: ".mysql_error());
if ($result) echo "Rant posted to the soapbox.";
}
if ($submit)
submit_form();
else
display_form();
?>