Thursday, May 19, 2011

How to use PHP & Textarea


How to use PHP &  textarea This tutorial how to using PHP read a variable from input textarea
Example
php_textarea1.php
  1. <html>  
  2. <head>  
  3. <title>ShotDev.Com Tutorial</title>  
  4. </head>  
  5. <body>  
  6. <form action="php_textarea2.php" method="post" name="form1">  
  7. <textarea name="txtDescription" cols="20" rows="3"></textarea>  
  8. <input name="btnSubmit" type="submit" value="Submit">  
  9. </form>  
  10. </body>  
  11. </html>  
php_textarea2.php
  1. <html>  
  2. <head>  
  3. <title>ShotDev.Com Tutorial</title>  
  4. </head>  
  5. <body>  
  6. <?  
  7. echo $_POST["txtDescription"];  
  8. echo "<hr>";  
  9. echo nl2br($_POST["txtDescription"]);  
  10. ?>  
  11. </body>  
  12. </html>  
Create a php file and save to path root-path/myphp/
Screenshot
PHP Textarea
PHP Textarea
.
.
.
Download this script.
Download

No comments:

Post a Comment