jaas Posted November 12, 2008 Share Posted November 12, 2008 hi, My code goes like this : <HTML FORM action="text.php" method="post"> here I am submitting textarea = "I am jaas" </HTML FORM> when it goes to browser it goes like some path?textarea=I00A00am00A00jaas actually there are some different characters.to give example I am using '00A00' instead of that. After that I am fetching this in a php code "text.php" as follows : <?php $tmp_text = $_GET["textarea"]; echo $tmp_text; ?> Result is "I am jaas" and not the expected. Please tell me the way out. Regards. Link to comment https://forums.phpfreaks.com/topic/132383-solved-how-to-replace-new-line-posted-html-form-by/ Share on other sites More sharing options...
luca200 Posted November 12, 2008 Share Posted November 12, 2008 Hard to say how mysql is involved, anyway there's a function called nl2br(). Try it. Hard to say how you can get form data in $_GET if your form has method="post", too. Link to comment https://forums.phpfreaks.com/topic/132383-solved-how-to-replace-new-line-posted-html-form-by/#findComment-688304 Share on other sites More sharing options...
jaas Posted November 12, 2008 Author Share Posted November 12, 2008 hi, One can send data by using both $_GET and $_POST. But $_POST is more secure and preffered. Link to comment https://forums.phpfreaks.com/topic/132383-solved-how-to-replace-new-line-posted-html-form-by/#findComment-688312 Share on other sites More sharing options...
JasonLewis Posted November 12, 2008 Share Posted November 12, 2008 MySQL? Huh? And the question... What? Please rephrase it. Your HTML is incorrect. Forms look like this: <form action="nextpage.php" method="post"> <textarea name="comment"></textarea> </form> And how is the value of the textarea ending up in your URL if you are using 'post' as your method. Doesn't make sense. Link to comment https://forums.phpfreaks.com/topic/132383-solved-how-to-replace-new-line-posted-html-form-by/#findComment-688413 Share on other sites More sharing options...
jaas Posted November 13, 2008 Author Share Posted November 13, 2008 ohhh...thanks for the reply. But as you know the form code is incorrect. Yaa, its a quick re-type of the code. And about My-SQL, the place where I have written "echo $tmp_text; " there is an insert statement in database. Link to comment https://forums.phpfreaks.com/topic/132383-solved-how-to-replace-new-line-posted-html-form-by/#findComment-689090 Share on other sites More sharing options...
LuigiLA Posted November 13, 2008 Share Posted November 13, 2008 Hi guys, I have a similar issue. I have a website where I post reviews for plays, musicals, etc. On the Review page, I have something like this, to output Title, Image, and the Review Text <h1><?php echo $row_rs_review['reviewTitle']; ?></h1><br /> <p><img src="_revIMG/<?php echo $row_rs_review['reviewIMG']; ?>"/> </p> <p><?php echo $row_rs_review['reviewDesc']; ?><br /> The problem is that all of my reviews are long and often separated by paragraphs. How can I display the text properly without being shown continuously? Link to comment https://forums.phpfreaks.com/topic/132383-solved-how-to-replace-new-line-posted-html-form-by/#findComment-689093 Share on other sites More sharing options...
LuigiLA Posted November 13, 2008 Share Posted November 13, 2008 nvm, fixed it with nl2br() Link to comment https://forums.phpfreaks.com/topic/132383-solved-how-to-replace-new-line-posted-html-form-by/#findComment-689100 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.