Hey...
I'm wondering if someone has a simple PHP code that will work for a blog? I want to create a simple interface for myself that I can update form anywhere....
Basically all I need is a PHP that will write to a .txt file and then I can call the .txt file from flash so that the text in my Flash is dynamic.
Below is something I did a while ago I am trying to recycle for this. It was originally to have messages posted one under another on a site. This basically does what I need it to do in terms of writing to a .txt file but it also writes the style of the font etc. All I want in the final .txt file is the text that will be called into Flash. Can someone help with this?
<?PHP
$filename = "guestbook6.txt"; #CHMOD to 666
$text = "";
if (isset($POST["submit"])) {
$name = htmlspecialchars($POST["name"]);
$message = htmlspecialchars($_POST["message"]);
$date = date ("l, F jS, Y");
$time = date ("h:i A");
$value = $message."<br>\n<span style=\"font-family: helvetica, arial, sans-serif; font-size: 70%; font-weight: bold;\">added to by $name at $time on $date.</span>\n<break>\n";
##Write the file##
$fp = fopen ($filename, "a");
if ($fp) {
fwrite ($fp, $value);
fclose ($fp);
}
else {
echo ("entry couldnt be added");
}
}
?>
thanks!
d