Jump to content

Output php inside html textarea


chopps

Recommended Posts

Hello All,

 

I have been struggling with this one for a while.  I have created a form in a dev environment which will post back to itself.  Once it posts back to itself it should have an html textarea at the top which works and the rest of the php works as well.  However, I have not been able to display the output of the code generated by PHP in the text area.  I have tried several ways and have still been unable; I have included one of these ways below:

 

if(isset($_POST['submit'])) {

  $ossl->do_csr();

  echo "<p>CSR: <TEXTAREA Name=\"comments\" rows=\"30\" cols=\"90\" value=\"<?php echo $ossl->csr; ?>\"></TEXTAREA></p>";

 

Does anyone know how to accomplish this?

 

P.S. Kinda new at this so please excuse my ignorance

Link to comment
https://forums.phpfreaks.com/topic/205951-output-php-inside-html-textarea/
Share on other sites

Being that we know nothing about the class $ossl, or what the function do_csr() does, or what the variable $csr holds, we couldn't possibly tell you what is wrong.  You do need to change 1 line though.

 

//This line:
echo "<p>CSR: <TEXTAREA Name=\"comments\" rows=\"30\" cols=\"90\" value=\"<?php echo $ossl->csr; ?>\"></TEXTAREA></p>";
//should be:
echo "<p>CSR: <textarea name=\"comments\" rows=\"30\" cols=\"90\">{$ossl->csr}</textarea></p>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.