Automatically populate Textarea with PHP variables

How can I automatically fill the text area below with two PHP variables, $ submission and $ fullurl?

<form method='post' action='index.php'>

<br />

<textarea  name="tweet" cols="50" rows="5" id="tweet" ></textarea>

<br />

<input type='submit' value='Tweet' name='submit' id='submit' />

</form>
+5
source share
1 answer

<textarea> default values ​​are set:

<textarea>value</textarea>

So use something like:

<textarea name="tweet" cols="50"rows="5" id="tweet"><?php echo $submission ?> <?php echo $fullurl ?></textarea>

Note that any spaces appear as-is in the text area, so newlines will cause newlines to appear in the text field.

+8
source

All Articles