i cant get text with punctuation using a text area to save to the database... and i can not get messages saved to the data base to show new line spaces using the enter key
ex:
this
is
what
should
happen
and this is how the text turns out
this is what should happen
this below is the script im trying to use
<?
include 'header.php';
$timesent = time() + -21750;
if ($_POST['newmessage'] != ""){
$result= mysql_query("INSERT INTO `grpgforums` (`forumnum`, `from`, `timesent`, `subject`, `msgtext`, `reply`)"."VALUES ('1', '".$user_class->id."', '', '".$_POST['subject']."', '".$_POST['msgtext']."', '0')");
echo Message("Message successfully added.");
}
?>
<tr><td class="contenthead">Mailbox</td></tr>
<tr><td class="contentcontent">
<table width='100%'>
<tr>
<td colspan='25%'>Subject</td>
<td width='25%'>Date</td>
<td width='25%'>Author</td>
</tr>
<?
$result = mysql_query("SELECT * FROM `grpgforums` WHERE `reply`='0' ORDER BY `id` DESC");
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
if (strtoupper($row['reply']) == strtoupper(0)) {
$from_user_class = new User($row['from']);
$subject = ($row['subject'] == "") ? "No Subject" : $row['subject'];
}
echo "
<tr>
<td colspan='25%'><a href='viewpost.php?id=".$row['id']."'>".$subject."</a></td>
<td width='25%'></td>
<td width='25%'>".date(F." ".d.", ".Y." ".g.":".i.":".sa,$row['timesent'])."</td>
</tr>
";
}
?>
</table>
</td></tr>
<tr><td class="contenthead">New Message</td></tr>
<tr><td class="contentcontent">
<table width='100%'>
<form method='post'>
<tr>
<td width='15%'>Subject:</td>
<td width='85%'><input type='text' name='subject' size='70' maxlength='75' value='<? echo ($_GET['reply'] != "") ? "Re: ".$worked2['subject'] : ""; ?>'></td>
</tr>
<tr>
<td width='15%'>Message:</td>
<td width='85%' colspan='3'><textarea name='msgtext' cols='53' rows='7'><? echo ($_GET['reply'] != "") ? " \n<br> -------- <br>\n ".$worked2['msgtext'] : ""; ?></textarea></td>
</tr>
<tr>
<td width='100%' colspan='4' align='center'><input type='submit' name='newmessage' value='Send'></td>
</tr>
</form>
</table>
</td></tr>
<?
include 'footer.php';
?>