Ok here is the more detailed of what i have. I have a form where user type their messages and that goes to a database then displays it. I need the php output to be inside a textarea so I could scroll through the messages.
[ FORM ]
<input name="user" type="text" value="" style="width:135; height:17"> :<strong style='font-size: 10px;color:#666699;'>Username</strong>
<textarea name="mynotes" style="width:430; height:80"></textarea><br />
<input name="submitField" type="submit" value=" post new note " style='font-size: 10px;background-color:#666699;color:#ffffff;height:23'>
[code=php]
<?
if ((!$day || !$year || $month) && !$mydate) {
$mydate = date("Y-m-d");
} else {
$month = $month+1;
if ($month && $year && $day) {
$mydate = "$year-$month-$day";
}
}
echo "<strong style='font-size: 13px;color:#666699;'>$mydate</strong><br /><br />";
echo "<input type=\"hidden\" name=\"mode\" value=\"gowrite\">";
echo "<input type=\"hidden\" name=\"mydate\" value=\"$mydate\">";
$sql = "select * from notes where notes_date='$mydate' order by notes_time desc";
$result = mysql_query($sql);
while ($row=mysql_fetch_array($result)) {
echo "
<textarea name="mynotes" style="width:430; height:100">
<strong style='font-size: 11px;'>$row[notes_user]</strong> $row[notes_time]
/n
<br/>".nl2br(stripslashes($row[notes_note]))."<br /><br />
</textarea>
";
}
mysql_free_result($result);
if ($mynotes && $user) {
if ($allowhtml == "0") {
$mynotes = str_replace("<", "<", "$mynotes");
$mynotes = str_replace(">", ">", "$mynotes");
}
if ($mydate && $todayonly == "0") {
$sql = "insert into notes (notes_date,notes_note,notes_time,notes_user) values ('$mydate','$mynotes',CURTIME(),'$user')";
} else {
$mydate = date("Y-m-d");
$sql = "insert into notes (notes_date,notes_note,notes_time,notes_user) values ('$mydate','$mynotes',CURTIME(),'$user')";
}
mysql_query($sql) or die("error 324343");
$adate = explode("-", $mydate);
$mymonth = $adate[1]-1;
header("Refresh:0;url=$PHP_SELF?day=$adate[2]&month=$mymonth&year=$adate[0]");
}
if ($todayonly == "1") {
$posttext = "<strong style='font-size: 10px;color:#666699;'>Note: You can only post under today's date</strong>";
} else {
$posttext = "<strong style='font-size: 10px;color:#666699;'>Note: You can post notes under any date, past, present or future</strong>";
}
?>