doubledee Posted April 18, 2012 Share Posted April 18, 2012 I could use some help converting this HTML... <textarea id="question1" name="answerArray[1]" cols="60" rows="2"><?php if (isset($answerArray[1])){echo htmlentities($answerArray[1], ENT_QUOTES);}? ></textarea> ...into PHP. This is what I have so far, but I'm getting messed up with the Sticky Form part... echo '<textarea id="question' . $questionNo . '" name="qaArray[' . $questionID . ']" cols="60" rows="2"> ' . '<?php if (isset($qaArray[' . $questionID . '])){echo htmlentities($qaArray[' . $questionID . '], ENT_QUOTES);} ?></textarea>'; Thanks, Debbie Quote Link to comment https://forums.phpfreaks.com/topic/261149-converting-html-input-into-php/ Share on other sites More sharing options...
Drummin Posted April 18, 2012 Share Posted April 18, 2012 Not tested Debbie, but you might try this. echo '<textarea id="question' . $questionNo . '" name="qaArray[' . $questionID . ']" cols="60" rows="2">' . (isset($qaArray[$questionID]) ? "htmlentities($qaArray[$questionID], ENT_QUOTES" : '').'</textarea>'; You can also try breaking it apart like this. echo '<textarea id="question' . $questionNo . '" name="qaArray[' . $questionID . ']" cols="60" rows="2">'; if (isset($qaArray[' . $questionID . '])){echo "htmlentities($qaArray[' . $questionID . '], ENT_QUOTES)";} echo '</textarea>'; Quote Link to comment https://forums.phpfreaks.com/topic/261149-converting-html-input-into-php/#findComment-1338303 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.