Problem text formatting in TEXTAREA
Posted: Mon Sep 22, 2003 5:35 am
Hello thr
My name is Jd..and well today was my first day at job and i was assigned a task in PHP..Im not actually a PHP Programmer but have done the basics like DataBase connectivity...The problem i am facing is that first i had to save and retrieve data completly formatted like the carrige returns and stuff i did it but when i show it in a TEXTAREA it includes the <br/> n stuff i don wan it to show the actual tags...i used the htmlspecialchars as well but no use can any body temme wat to do???
$result = mysql_query("SELECT * from newsTable",$db);
while($myrow = mysql_fetch_array($result))
{
$myrow["comments"] = htmlspecialchars($myrow["comments"]);
$myrow["comments"] = nl2br($myrow["comments"]);
echo "Comment Start";
echo "<textarea rows=2 name=comments cols=20>".$myrow["comments"];
echo "</textarea>";
echo "<br>Comment End <br>";
}?>
My name is Jd..and well today was my first day at job and i was assigned a task in PHP..Im not actually a PHP Programmer but have done the basics like DataBase connectivity...The problem i am facing is that first i had to save and retrieve data completly formatted like the carrige returns and stuff i did it but when i show it in a TEXTAREA it includes the <br/> n stuff i don wan it to show the actual tags...i used the htmlspecialchars as well but no use can any body temme wat to do???
$result = mysql_query("SELECT * from newsTable",$db);
while($myrow = mysql_fetch_array($result))
{
$myrow["comments"] = htmlspecialchars($myrow["comments"]);
$myrow["comments"] = nl2br($myrow["comments"]);
echo "Comment Start";
echo "<textarea rows=2 name=comments cols=20>".$myrow["comments"];
echo "</textarea>";
echo "<br>Comment End <br>";
}?>