SJames Posted August 27, 2007 Share Posted August 27, 2007 I have the following two files. <?php print "<form method=post action=\"secondfile.php\"> $variable = "Text"; $content = "<a name=\"$variable\">$variable</a>"; // There is a \ before the "$var..., but for some reason it doesn't show up on this webpage. print "<textarea name=\"content\">$content</textarea>"; print "<input type=submit>"; print "</form>"; ?> secondfile.php <form method=post action="otherfile.php"> <textarea name="content"> <?php print $_POST['content']; ?> </textarea> <input type=submit> </form> Obviously these files have been simplified and had filenames changes, but my problem persists even with these simple files. These files work properly, but what is printed in the textarea on the second page is not correct. It should be equal to $content from the first page, or: <a name="Text">Text</a> however, what is printed is: <a name=\"Text\">Text</a> I don't know why it is adding the \ , any help would be nice. Link to comment https://forums.phpfreaks.com/topic/66826-problem-with-textarea/ Share on other sites More sharing options...
vijayfreaks Posted August 27, 2007 Share Posted August 27, 2007 Hi.. this is because you are using it with echo or print.. so you have to add it.. have changed some code over here: <?php print "<form method=post action=\"secondfile.php\">"; $variable = "Text"; $content = "<a name=\"$variable\">$variable</a>"; // There is a \ before the "$var..., but for some reason it doesn't show up on this webpage. print "<textarea name=\"content\">$content</textarea>"; print "<input type=submit>"; print "</form>"; ?> suppose this will help you.. Vijay Link to comment https://forums.phpfreaks.com/topic/66826-problem-with-textarea/#findComment-335016 Share on other sites More sharing options...
SJames Posted August 27, 2007 Author Share Posted August 27, 2007 What is different in your version of the code? Link to comment https://forums.phpfreaks.com/topic/66826-problem-with-textarea/#findComment-335018 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.