dennismonsewicz Posted May 8, 2008 Share Posted May 8, 2008 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 More sharing options...
DeanWhitehouse Posted May 8, 2008 Share Posted May 8, 2008 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 Link to comment https://forums.phpfreaks.com/topic/104740-solved-textarea-problem/#findComment-536146 Share on other sites More sharing options...
dennismonsewicz Posted May 8, 2008 Author Share Posted May 8, 2008 <p> and <font> Link to comment https://forums.phpfreaks.com/topic/104740-solved-textarea-problem/#findComment-536147 Share on other sites More sharing options...
DeanWhitehouse Posted May 8, 2008 Share Posted May 8, 2008 they shouldn't affect it , are they closed? Link to comment https://forums.phpfreaks.com/topic/104740-solved-textarea-problem/#findComment-536149 Share on other sites More sharing options...
dennismonsewicz Posted May 8, 2008 Author Share Posted May 8, 2008 yes they are closed. and I tried your code and it didn't work and your code should've been this: <?php echo $row['welcome'];?> Link to comment https://forums.phpfreaks.com/topic/104740-solved-textarea-problem/#findComment-536151 Share on other sites More sharing options...
DeanWhitehouse Posted May 8, 2008 Share Posted May 8, 2008 ok, soz, i am still learning. Is it just the content not loading? Link to comment https://forums.phpfreaks.com/topic/104740-solved-textarea-problem/#findComment-536153 Share on other sites More sharing options...
dennismonsewicz Posted May 8, 2008 Author Share Posted May 8, 2008 yeah, i don't understand why its not loading. Everywhere I have looked (using google) suggests exactly what I am doing. Now I am using tinymce to handle my textareas but that shouldn't matter Link to comment https://forums.phpfreaks.com/topic/104740-solved-textarea-problem/#findComment-536155 Share on other sites More sharing options...
BlueSkyIS Posted May 8, 2008 Share Posted May 8, 2008 assuming you are retrieving a record and there is a field called welcome with data in it, try: htmlspecialchars($row['welcome'], ENT_QUOTES); Link to comment https://forums.phpfreaks.com/topic/104740-solved-textarea-problem/#findComment-536156 Share on other sites More sharing options...
dennismonsewicz Posted May 8, 2008 Author Share Posted May 8, 2008 that didn't work what does the ENT_QUOTES do? Link to comment https://forums.phpfreaks.com/topic/104740-solved-textarea-problem/#findComment-536161 Share on other sites More sharing options...
BlueSkyIS Posted May 8, 2008 Share Posted May 8, 2008 are you certain that 1. you are getting a record, 2. that record has a field called welcome, and 3. that field is not empty? i'd bet that one of those items is not true. http://us3.php.net/htmlspecialchars Link to comment https://forums.phpfreaks.com/topic/104740-solved-textarea-problem/#findComment-536165 Share on other sites More sharing options...
dennismonsewicz Posted May 8, 2008 Author Share Posted May 8, 2008 I just echoed $row['welcome'] and it retrieved the file out of the database Link to comment https://forums.phpfreaks.com/topic/104740-solved-textarea-problem/#findComment-536189 Share on other sites More sharing options...
BlueSkyIS Posted May 8, 2008 Share Posted May 8, 2008 can we see more of the latest code? Link to comment https://forums.phpfreaks.com/topic/104740-solved-textarea-problem/#findComment-536194 Share on other sites More sharing options...
dennismonsewicz Posted May 8, 2008 Author Share Posted May 8, 2008 $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>"; Link to comment https://forums.phpfreaks.com/topic/104740-solved-textarea-problem/#findComment-536196 Share on other sites More sharing options...
BlueSkyIS Posted May 8, 2008 Share Posted May 8, 2008 where is $row['welcome'] set? Link to comment https://forums.phpfreaks.com/topic/104740-solved-textarea-problem/#findComment-536197 Share on other sites More sharing options...
dennismonsewicz Posted May 8, 2008 Author Share Posted May 8, 2008 $id = $_GET['id']; $query = mysql_query("SELECT * FROM issues WHERE ezine_id = '$id'") or die("ERROR: " . mysql_error()); $row = mysql_fetch_array($query); Link to comment https://forums.phpfreaks.com/topic/104740-solved-textarea-problem/#findComment-536198 Share on other sites More sharing options...
dennismonsewicz Posted May 8, 2008 Author Share Posted May 8, 2008 bump Link to comment https://forums.phpfreaks.com/topic/104740-solved-textarea-problem/#findComment-536217 Share on other sites More sharing options...
dennismonsewicz Posted May 8, 2008 Author Share Posted May 8, 2008 Funny story... I did a hard refresh and the content loaded into the textarea very wierd Link to comment https://forums.phpfreaks.com/topic/104740-solved-textarea-problem/#findComment-536218 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.