meomike2000 Posted March 10, 2009 Share Posted March 10, 2009 i have created a simple messenger with php.... to enter message i have used a simple html form with some input areas and one textarea to type the message in. all that works great... problem is that i have a reply page and on that form it fills in the proper information and i would like to be able to put the original message infor in that form, problem i have is that i would like to have a couple of blank lines at the top of the textarea and then display the message data.... no matter what i try it will not work.... anybody have a fix for this... thanks mike.... Quote Link to comment https://forums.phpfreaks.com/topic/148714-solved-help-with-form-and-textareaplease/ Share on other sites More sharing options...
haku Posted March 10, 2009 Share Posted March 10, 2009 default="\n\n Default text" I think that should do what you want. Quote Link to comment https://forums.phpfreaks.com/topic/148714-solved-help-with-form-and-textareaplease/#findComment-780927 Share on other sites More sharing options...
meomike2000 Posted March 10, 2009 Author Share Posted March 10, 2009 would this be what you mean..... <textarea rows="5" cols="50" wrap=hard name="message" default="\n\n reply to"></textarea><br> cause that dont work...... nothing changed. also have tried.... <textarea rows="5" cols="50" wrap=hard name="message">default="\n\n reply to"</textarea> and that actually displays in the box: default="\n\n reply to" ... Quote Link to comment https://forums.phpfreaks.com/topic/148714-solved-help-with-form-and-textareaplease/#findComment-781290 Share on other sites More sharing options...
lonewolf217 Posted March 10, 2009 Share Posted March 10, 2009 i am making the assumption here that you are passing the original message via a form <?php $desc = "<br><hr>Original Message:<br>" . $_POST['description']; ?> <textarea rows="5" cols="50" wrap=hard name="message" > <?php echo $desc ?> </textarea> Try this to see if it will work for you ></textarea><br> Quote Link to comment https://forums.phpfreaks.com/topic/148714-solved-help-with-form-and-textareaplease/#findComment-781306 Share on other sites More sharing options...
meomike2000 Posted March 10, 2009 Author Share Posted March 10, 2009 no...... i used this.... $message = "<br><br>".$row[1]." said// ".$row[3]; and it prints: <br><br>deb said// test new message in the box...... Quote Link to comment https://forums.phpfreaks.com/topic/148714-solved-help-with-form-and-textareaplease/#findComment-781354 Share on other sites More sharing options...
meomike2000 Posted March 10, 2009 Author Share Posted March 10, 2009 <textarea type="text/html" rows="5" cols="50" wrap=hard name="message">'; echo $message; '</textarea><br> <br> this is what i put and it still didnt work...... Quote Link to comment https://forums.phpfreaks.com/topic/148714-solved-help-with-form-and-textareaplease/#findComment-781357 Share on other sites More sharing options...
lonewolf217 Posted March 10, 2009 Share Posted March 10, 2009 thats wierd, it worked fine for me. not sure what else to try Quote Link to comment https://forums.phpfreaks.com/topic/148714-solved-help-with-form-and-textareaplease/#findComment-781358 Share on other sites More sharing options...
meomike2000 Posted March 10, 2009 Author Share Posted March 10, 2009 the page is wrote in php, and this is what the page looks like..... /open connection to database server. $connection = mysql_connect($host, $user, $pass) or die ('unable to connect!'); //select database to use. mysql_select_db($db) or die ('unable to select database!'); $query = "select fr_uid, fruser, sub, mess from messages where touid = '" . $userid . "' and mid = '".$mid."'"; $result = mysql_query($query) or die ('error getting page info:' . mysql.error()); $row = mysql_fetch_row($result); $message = "<br><br>".$row[1]." said// ".$row[3]; $error = $_SESSION['error']; $error_string = $error; $userid; echo $error_string. '<br > <form method="post" action="send_mess.php?userid=' .$userid. '">reply to message # '.$mid.'<br> To: <input type="text" name="to" size="30" value="'.$row[1].'"><br> <br> Subject: <input type="text" name="subj" size="30" value="RE: '.$row[2].'"><br> <br> <textarea type="text/html" rows="5" cols="50" wrap=hard name="message">'; //echo $message; '</textarea><br> <br> <input type="submit" name"submess" value="send"> <input type="reset" value="clear"><br> </form>'; unset ($_SESSION['error']); ?> what else could couse it to not work...... Quote Link to comment https://forums.phpfreaks.com/topic/148714-solved-help-with-form-and-textareaplease/#findComment-781364 Share on other sites More sharing options...
meomike2000 Posted March 10, 2009 Author Share Posted March 10, 2009 if i set it up like this it works somewhat..... $message = ' '.$row[1].' said// '.$row[3]; the problem is when i put the html in, it displays what i type instead of knowing that it is html code...... would still like some help here... never had to do this before now..... thanks mike....... Quote Link to comment https://forums.phpfreaks.com/topic/148714-solved-help-with-form-and-textareaplease/#findComment-781378 Share on other sites More sharing options...
lonewolf217 Posted March 10, 2009 Share Posted March 10, 2009 ignore my previous solution, I tested it incorrectly on my end. This however should work <?php echo "\n\n" . $message; ?> Quote Link to comment https://forums.phpfreaks.com/topic/148714-solved-help-with-form-and-textareaplease/#findComment-781381 Share on other sites More sharing options...
meomike2000 Posted March 10, 2009 Author Share Posted March 10, 2009 yes that way did work.... thank you so much for the help...... Quote Link to comment https://forums.phpfreaks.com/topic/148714-solved-help-with-form-and-textareaplease/#findComment-781395 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.