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. Quote 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 Quote 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? Quote Link to comment https://forums.phpfreaks.com/topic/66826-problem-with-textarea/#findComment-335018 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.