Jump to content

[SOLVED] Using PHP to get submitted info from textarea


garry

Recommended Posts

So this is my code, the user should submit a textarea and then I should be able to get the results on the next page. The form is to update a review. The problem is, whilst I get all the other data fine, the textarea retains the data ($body) that was initially put into it and does not update on the next page. Any idea why?

 

<form action="<?php $_SERVER['PHP_SELF']; ?>" method="POST">
    <table width="615" border="0">
       <tr>
        <td><div align="right">Album: </div></td>
        <td><input type="text" name="album" value="<?php echo $album; ?>"></td>
        <td><input type="hidden" name="albumid" value="<?php echo $albumid; ?>"></td>
        <td><input type="hidden" name="reviewid" value="<?php echo $reviewid; ?>"></td>
      </tr> 
      <tr>
        <td><div align="right">Review: </div></td>
        <td><textarea name="body" rows="20" cols="80"><?php echo $body; ?></textarea></td>
      </tr> 
      <tr>
        <td height="33"><input name="submitted2" type="hidden" value="1"></td>
        <td><input name="submit" type="submit" value="Edit" /></td>
      </tr>
    </table>
  </form>

 

Thanks!

i have done something similar with text box's.  what i used this for was getting a user to fill write some text and upload an image to go with it.  when they moved to the next page the text was displayed with the image.  how i done this if i can remember properly was

 

to set the text area up

 

<textarea id="broad_messagebody1"  name="broad_messagebody1" cols="50" rows="10" ></textarea><br />

 

this page was then submitted using a form

 

and when i wanted to display the text i created a span class

 

.mainTxt {font-size: 11px; color:#444444; font-family: Arial, Helvetica, sans;}

 

and then the code to display the text was

 

<span class="mainTxt">' . $broad_messagebody1 . '</span>

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.