Giving a variable to a textarea?

  • Pbpixels
  • Novice
  • Novice
  • User avatar
  • Posts: 17

Post 3+ Months Ago

Hey, this very simple code doesn't work of some reason.. I'm trying to put it into a project, but it just don't work the same way as input fields...
I have made this little example to show you:
PHP Code: [ Select ]
<html>
   <form>
      <textarea name="test" ></textarea>
      <input type="submit" name="submit" />
   </form>
</html>
<?php
$lol = $_POST['test'];
 
if (isset($_POST['submit'])) {
echo "$lol";
}
?>
  1. <html>
  2.    <form>
  3.       <textarea name="test" ></textarea>
  4.       <input type="submit" name="submit" />
  5.    </form>
  6. </html>
  7. <?php
  8. $lol = $_POST['test'];
  9.  
  10. if (isset($_POST['submit'])) {
  11. echo "$lol";
  12. }
  13. ?>


The textarea field simply wont accept its name and post it... Any ideas?

- PB Pixels
  • Satwant
  • Graduate
  • Graduate
  • User avatar
  • Posts: 127
  • Loc: Bangalore

Post 3+ Months Ago

Simple
The default form submit type is 'GET' and u are using $_POST[''] to retrieve values.

What kind of project it is where you are using this code ?? :)

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 74 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.