I'm using a form with a textfield in order to pubish news on my home page. The problem is that I can't press ENTER and begin a new paragraph because that paragraph will end up above all news entries and will be unformatted. It will look like this (look at the last entry, it continues above all the other entries).
I'm using the script below to save my entries in a text file. Is there something I can add to that script that would make it possible to press ENTER when writing news without messing up the front page?
This is the script I’m using to write news to a textfile:I hope you understand what I mean.PHP Code:<?
fopen("news.txt", "a+");
if($action == add){
$fp = fopen("news.txt", "a+");
$data="<span class=\"litenblue\">".date("d.m.Y")."</span> <br>";
$data.="<span class=\"liten\">".$form_text."</span> </p> \n";
fputs($fp, $data);
fclose($fp);
echo '
<html>
<head>
<META HTTP-EQUIV="REFRESH" CONTENT="1; url=yo.phtml">
</head>
<body></body>
</html>
';
}
else{?>
<form name="textform" method="post" action="update.phtml" class="texten">
<input type="hidden" name="action" value="add">
<p> <span class="texten">
<SCRIPT>
if (navigator.appName == 'Netscape') {
document.write('<textarea name="form_text" cols="25" rows="6" wrap="virtual"></textarea>\n');
} else {
document.write('<textarea name="form_text" cols="50" rows="6" class="formen" wrap="virtual"></textarea>\n');
}
</SCRIPT>
</span></p>
<p> <span class="texten">
<input type="submit" name="Submit" value="Skicka!">
</span></p>
</form>
<?
}
?>![]()




Very slowly... I haven't purchased any books yet, but I'm learning from ready made scripts that I'm using right now (I'm designing a personal site for my boyfriend's sister). The PHP gurus (yes, you are one of them) here at SitePoint are also very helpful and I don't know what I would do without you. Thank you for all your help!
I don't think I am!


Bookmarks