peppericious Posted February 27, 2011 Share Posted February 27, 2011 Hello all. I'm new here... and new to php... so please be gentle if I'm overlooking something that's blindingly obvious. I have a 'view blog entries' page and an 'edit blog entries' page. When I go to the 'edit blog entries' page, I want the form fields to display the preexisting blog content for whatever entry I'm about to edit. The code below does display the 'title' but it does not display the 'article' content. (However, the 'title' and 'article' content both show when I view the source code.) Can anyone tell me what I could be doing wrong? Thanks in advance. // Retrieve the blog post's information: $q = "SELECT title, article FROM entries WHERE article_id=$article_id"; $r = @mysqli_query ($dbc, $q); if (mysqli_num_rows($r) == 1) { // Valid blog entry ID, show the form. // Get the blog entry's information: $row = mysqli_fetch_array ($r, MYSQLI_NUM); echo '<form action="edit_entry.php" method="post"> <p>Title:<br /> <input type="text" name="title" size="45" maxlength="80" value="' . $row[0] . '" /></p> <p>Blog entry<br /> <textarea name="article" id="article" cols="45" rows="5" ' . $row[1] . '></textarea> </p> <p><input type="submit" name="submit" value="Submit" /></p> <input type="hidden" name="submitted" value="TRUE" /> <input type="hidden" name="article_id" value="' . $article_id . '" /> </form>'; } else { // Not a valid entry ID. echo '<p class="error">This page has been accessed in error.</p>'; } mysqli_close($dbc); ?> Quote Link to comment https://forums.phpfreaks.com/topic/229065-sticky-form-text-area-field-not-retaining-content/ Share on other sites More sharing options...
.josh Posted February 27, 2011 Share Posted February 27, 2011 textarea content/value goes between the actual tag <textarea>blahblah</textarea> Quote Link to comment https://forums.phpfreaks.com/topic/229065-sticky-form-text-area-field-not-retaining-content/#findComment-1180528 Share on other sites More sharing options...
peppericious Posted February 27, 2011 Author Share Posted February 27, 2011 textarea content/value goes between the actual tag <textarea>blahblah</textarea> Bingo. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/229065-sticky-form-text-area-field-not-retaining-content/#findComment-1180532 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.