roflmycrisps Posted March 15, 2012 Share Posted March 15, 2012 Hi! I have a text area on my webpage which takes in user php scripts and produces an output in an adjacent window. I am trying to find out how I can auto include some php tags into the input text area so that the user doesn't have to keep typing them in every time. <form name="form1" method="post" ACTION="editor.php"> <textarea rows="10" cols="60" id="code" name="code"></textarea> <span class="submitbutton">Test code</span> </form> Thanks in advance, Jay Link to comment https://forums.phpfreaks.com/topic/258973-include-php-tags-in-a-text-area/ Share on other sites More sharing options...
Muddy_Funster Posted March 15, 2012 Share Posted March 15, 2012 try: <form name="form1" method="post" ACTION="editor.php"> <textarea rows="10" cols="60" id="code" name="code"><?php echo '<pre><?php ?></pre>'; ?></textarea> <span class="submitbutton">Test code</span> </form> Link to comment https://forums.phpfreaks.com/topic/258973-include-php-tags-in-a-text-area/#findComment-1327584 Share on other sites More sharing options...
roflmycrisps Posted March 15, 2012 Author Share Posted March 15, 2012 Thanks! Never thought of echo'ing the tags out. I presumed it would break my interpreter for some reason. It worked anyway, cheers! Jay Link to comment https://forums.phpfreaks.com/topic/258973-include-php-tags-in-a-text-area/#findComment-1327591 Share on other sites More sharing options...
scootstah Posted March 15, 2012 Share Posted March 15, 2012 You can also use entities for the < > <textarea rows="10" cols="60" id="code" name="code"><?php ?></textarea> Link to comment https://forums.phpfreaks.com/topic/258973-include-php-tags-in-a-text-area/#findComment-1327644 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.