Q:

Set text in textarea with PHP

How can I set the text of a textarea object in PHP, is it necessary to use javascript.
I want to have one textarea, and be able to set the text that is displayed at different times.
Thanks

A:

<textarea rows="2" cols="20">
<?php echo "Your text here. This can be dynamically created with PHP
when the page is served."; ?>
</textarea>

So, the textarea can be filled with PHP, but if you want to change the textarea after the page has loaded.... once it's out of the hands of the server, then you have to use Javascript.

A:

If you want to change the text after it has been downloaded by the client (for example, have the text change every five seconds or something), you must use javascript. PHP is only used for server-side generation of the markup that the client downloads.

