Friday, July 31, 2009

How to use PHP to input text inside a textarea on a web page?

I want to place a string of text into another textarea on a webpage. for example, I want a textarea to say "Hi" when i press a button in a PHP form. Does this make sense?

How to use PHP to input text inside a textarea on a web page?
Just check if a post variable has been set and echo the content. e.g:





echo '%26lt;textarea%26gt;',(is_array($_POST) ? 'Hi' : ''),'%26lt;/textarea%26gt;';


No comments:

Post a Comment