Hello List,
being new to php, I have some problems writing the content of a textarea into a file. In my case, I always geht the error
rewind() errmsg
fputs()errmsg
fclose()errmsg ,
each functionname in the errormessage is followed by
"supplied argument is not a valid stream resource in file ... on line .."
Here is the excerpt of my code:
.
.
<form action="<php rcho $PHP_SELF; ?> method="post">
.
.
<table....
.
<td><textarea name="messages" rows=3 cols=40 scroll=yes wrap=soft></textarea><td>
..
.
</form>
$file="comment.txt"
if (isset($_POST[`messages']))
{
$pointer=fopen($_POST['file'],"r+"); <<<above error here
$_POST['messages']=stripslashes(nl2br($_POST['messages']));
rewind ($_POST['pointer']);
fputs($_Post['pointer',$_POST['messages'); <<<above error here
fclose($_POST['pointer']); <<<above error here
}
?>
I can't see right now, what is wrong with the code.
Can anybody help me? Any help is apreciated.
Thanks for your help in advance.
Best regards,
Fred
being new to php, I have some problems writing the content of a textarea into a file. In my case, I always geht the error
rewind() errmsg
fputs()errmsg
fclose()errmsg ,
each functionname in the errormessage is followed by
"supplied argument is not a valid stream resource in file ... on line .."
Here is the excerpt of my code:
.
.
<form action="<php rcho $PHP_SELF; ?> method="post">
.
.
<table....
.
<td><textarea name="messages" rows=3 cols=40 scroll=yes wrap=soft></textarea><td>
..
.
</form>
$file="comment.txt"
if (isset($_POST[`messages']))
{
$pointer=fopen($_POST['file'],"r+"); <<<above error here
$_POST['messages']=stripslashes(nl2br($_POST['messages']));
rewind ($_POST['pointer']);
fputs($_Post['pointer',$_POST['messages'); <<<above error here
fclose($_POST['pointer']); <<<above error here
}
?>
I can't see right now, what is wrong with the code.
Can anybody help me? Any help is apreciated.
Thanks for your help in advance.
Best regards,
Fred