Jump to content

[SOLVED] textarea problem


Recommended Posts

echo "<div class='editor' style='text-align: center'>";
						echo "<p class='editortitle' style='font-size: 175%; padding: 4px 0px 4px 0px; margin: 0px;'>Welcome Letter</p>
			                	<textarea cols='80' rows='25' name='welcome'>" . $row['welcome'] . "</textarea>";
					echo "</div>";

 

The following code above should work right? In the database there is html tags, could this cause the content to not load?

Link to comment
https://forums.phpfreaks.com/topic/104740-solved-textarea-problem/
Share on other sites

what are the HTML tags in the database?

 

also try this

?>

<div class="editor" style="text-align: center">
<p class="editortitle" style="font-size: 175%; padding: 4px 0px 4px 0px; margin: 0px;">Welcome Letter</p>
<textarea cols="80" rows="25" name="welcome"><?php echo"" . $row['welcome'] . ""; ?></textarea>
</div>
<?php

$allowedTags='<p><strong><em><u><h1><h2><h3><h4><h5><h6><img>';
				$allowedTags.='<li><ol><ul><br><ins><del>';

			$sContent = strip_tags(stripslashes($row['welcome']),$allowedTags);
       
echo "<div class='editor' style='text-align: center'>";
						echo "<p class='editortitle' style='font-size: 175%; padding: 4px 0px 4px 0px; margin: 0px;'>Welcome Letter</p>
			                	<textarea cols='80' rows='25' name='welcome'>" . $sContent . "</textarea>";
					echo "</div>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.