textarea's not being add to data base?
Posted: Wed Jul 02, 2003 9:35 am
Making a little thing where u can send messages to team mates and stuff like that. Just started out making a table name memebers 4 fields ID, Name, Team, and Messages.
To add data i used this form.
and this php code
Then I'm using a simple fench_array to echo out everything in the data base and messages is not coming out. I'm sure its cus its a textarea cus i changed it to a single line and it came out fine.. Its prolly something simple fink its in my messages.php code above. any help thanks!
darkside!
To add data i used this form.
Code: Select all
<form action="messages.php" method="POST">
<p>Username:
<input type="text" name="Name" size="20">
<br>
Message:
<textarea name="Messages"></textarea>
<br>
Team?
<select name="Team">
<option value="client" selected>Client</option>
<option value="Team">Team</option>
</select>
<br>
<input type="submit" value="Send!">
</p>
</form>Code: Select all
include("config.inc");
$Mestable = "messages";
if(!($link_id = mysql_connect($Host, $User, $Pass))) die(mysql_erorr());
mysql_select_db($DB);
$sql = "INSERT INTO " . $Mestable . " VALUES('',
'". addslashes($_POSTї'Name']) . "'
, '" . addslashes($_POSTї'Team']) . "'
, '" . addslashes($_POSTї'Messages']) . "'
)";
if(!($result = mysql_query($sql))) {
die(mysql_error());
} else {
echo "Your message has been added!<br>";
echo "<a href=mesdisplay.php>Continues</a> to the messages page";
}darkside!