soma56 Posted June 11, 2010 Share Posted June 11, 2010 I had a thread a few days ago inquiring about placing your results in a text box. I was told that you could wrap your html around your php code. Fair enough. I've been playing around with getting lists, placing them into arrays and echoing the results. <?PHP print <<<EOT <form method="post" action="" > <table> <tr> <td>My Grocery List: </td> <td><textarea name="list" type="text" cols="30" rows="6" id="list"></textarea></td> </tr> <tr> <td><input type="submit" value="Submit"></td> </tr> </table> </form> <form> <table> <fieldset> <td><textarea name="list" type="text" cols="30" rows="6" id="list"> EOT; if (!isset($_POST['list'])) { //If not isset -> set with dummy value $_POST['list'] = ""; } $list = trim($_POST["list"]); $data = explode("\n", "$list"); foreach ($data as $value) echo $value; print <<<EOT <tr> <td><input type="reset" value="Clear"></td> </tr> </fieldset> EOT; ?> Everything works correctly however the last half of the html is inside the second text box. Where did I go wrong? Link to comment https://forums.phpfreaks.com/topic/204456-2nd-half-of-html-showing-up-in-textarea/ Share on other sites More sharing options...
jcbones Posted June 11, 2010 Share Posted June 11, 2010 You need to close it up. </textarea> Link to comment https://forums.phpfreaks.com/topic/204456-2nd-half-of-html-showing-up-in-textarea/#findComment-1070655 Share on other sites More sharing options...
soma56 Posted June 11, 2010 Author Share Posted June 11, 2010 Thanks...It's real late here.....(didn't notice that) Link to comment https://forums.phpfreaks.com/topic/204456-2nd-half-of-html-showing-up-in-textarea/#findComment-1070662 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.