Jump to content

[SOLVED] help with form and textarea......please....


meomike2000

Recommended Posts

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....

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" ...

 

 

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>

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......

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.......

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.