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
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>";

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.