0

I have the following problem. I want to echo a php variable in a html textarea. But i cant get it to work out for me. Here is my code.

<?php

$y = 123

?>

<textarea name="delay" cols="50"rows="5" id="delay">
<?php echo $y ?>
</textarea>

Here is what I see

enter image description here

halfer
  • 19,824
  • 17
  • 99
  • 186
Philxad
  • 3
  • 3

1 Answers1

0

an easy way could be:

<?php

$y = 123;

echo "<textarea title='textarea' name='delay' cols='50' rows='5' id='delay'>".$y."</textarea>";

?>

also between cols="50"rows="5" should be an blankspace. like: cols="50" rows="5"

Blueblazer172
  • 588
  • 2
  • 15
  • 44