Hi all again
Well I have my form writing to my file as I want, but there is a another problem I have come accross which i do not have a clue about.
Just to explain what I am doing.
I have a form where details are filled out, when posted the values are echoed :<?php echo $name?> for example into the layout so the person can see what it looks like, I also <?php echo $name?> the content into another form in the Init val, so if the user wants to change anything they can. Once they hit submit it goes to my file write script:
<?
$filename = "news.txt";
if ($message)
{
$link = strip_tags($link);
$title = strip_tags($subject);
$name = strip_tags($name);
$message = strip_tags($content);
if (get_magic_quotes_gpc())
{
$message = stripslashes($content);
$name = stripslashes($name);
$title = stripslashes($subject);
$link = stripslashes($link);
}
$message = ereg_replace("\r\n\r\n", "\n", $message);
$date = date("l, F j Y,");
$message = "<B>$subject </B><BR> $content <BR> $link<BR>Posted by: $name on $date \n";
$fp = fopen($filename,"w");
fwrite ($fp, $message );
fclose ($fp);
}
?>
Which writes the data to news.txt, or should I say should do.
What I have noticed is when I use <?php echo $name?> in the Init val of the forms on this page it does not right to the file, as soon as I remove the <?php echo $name?> from the Init val it works fine ???????
anyone know a work around or tell me what I am doing wrong please.
Thanks
TheDon