Hey. I'm a newbie to PHP and in fact this is my first script. Its not working for some reason. Its a chat room attempt. (There could just be a silly mistake like forgetting a semicolon, but like i said i'm a newbie). Oh this is just one page that opens a file then prints the files contents. The form is one the same page. Enough talking here is the script.
-----SCRIPT------------
<?php
$name = $post[name]; //get name
$message = $post[message]; //get message
fopen ("another.txt", "a"); //open file
fwrite ($name ":" $message); //write
fclose ("another.txt"); //close
?>
<TABLE WIDTH="68%" BORDER="0" BGCOLOR="#000000" CELLSPACING="5" CELLPADDING="5">
<TD BGCOLOR="#AAAAAA">
<FORM ACTION="muck.php" METHOD="post">//c8 form
Name: <INPUT TYPE="text" NAME="name" SIZE="15" MAXLENGTH="15" VALUE="<?php echo ($name); ?>"><BR>//get name from last page
Message: <BR><TEXTAREA COLS="50" ROWS="3" NAME="message"></TEXTAREA>
<INPUT TYPE="submit" VALUE="Send!">
</FORM>
</TABLE>
<BR>
<TABLE WIDTH="68%" BORDER="0" BGCOLOR="#000000" CELLSPACING="5" CELLPADDING="5">
<TD BGCOLOR="#AAAAAA">
<FORM>
<TEXTAREA COLS="80" ROWS="10" NAME="chat">
<?php
$message_array = fopen ("another.txt", "r");
$message_read = fread ($message_array, filesize ($message_array));
echo ($message_read);
?>
</TEXTAREA>
</FORM>
</TABLE>
----End script-------
Thankyou.