Hi all,
Well after getting slated yesterday for trying to take the easy way out I have been try today and last night to do the job myself, but it is still not working, can someone tell me what I am doing wrong please.
This is my form that I am using to get my data:
<form name="news" method="post" action="write.php3">
<input type="text" name="$name">
<input type="text" name="$link">
<input type="text" name="$title">
<textarea name="$message" cols="40"></textarea>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
I am trying to send my values to my write.php3 script see below:
<?
$filename = "test.txt";
if ($message)
{
$link = strip_tags($link);
$title = strip_tags($title];
$name = strip_tags($name);
$message = strip_tags($message,"<a>,<b>,<i>,<p>,<br>");
if (get_magic_quotes_gpc())
{
$message = stripslashes($message);
$name = stripslashes($name);
$title = stripslashes($title);
$link = stripslashes($link);
}
$message = ereg_replace("\r\n\r\n", "\n<P>", $message);
$date = date("l, F j Y, h:i a");
$message = "<B>$title </B><P>$message <P>$name $date \n";
$fp = fopen($filename, 'r');
fwrite ($fp, $message );
fclose ($fp);
}
?>
What I am trying to do is to get my write.php3 to write the values to test.txt
So far the only thing that works is the form when I hit submit. LOL
I am very new to php (2 days to be excact) so if my code looks stupid or I am missing something out very import that is my excuse.
If anyone can help me out here or point me in the right direction please that would be great.
Thanks
TheDon