as i you see your trying to implement a chatting system. Use form submission, instead of onclick events
<?php
if($_POST['btnsubmit']){
$user = $_POST'user'];
$msg = $_POST['msg'];
$con = mysql_connect("localhost","host"); // i hope you can already connect successfully
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$now = time(); // now
$date = date("Y-m-d",$now);
$time = date("h:i:s",$now);
mysql_select_db("chat",$con);
mysql_query("INSERT INTO chat (Name, Date, Content, Time) VALUES ('".$user."','".$date."','".$msg."','".$time."')"); // i hope you set your date field to data type date, and you set your time field to data type time
mysql_close($con);
}
?>
<form method="post">
User: <input type="text" name="user" /><br />
Message: <textarea name="msg"></textarea><br />
<input type="submit" name="btnsubmit" value="send" />
</form>
but if the scenario really require onclick events then, ill re-design the code, the reason why i abandon your javascript coz im kinda puzzled on what you really tryin to save, like this part
fTxt =("You entered" + ": " + text1 + " " + ":" + dT);
i assume you storing ftxt to string, something like "You entered: hello!:Wed Jun 30 2010 17:18:23 GMT+0800 (Taipei Standard Time)" the Date() in javascript returns a formatted date, unlike PHP date which returns timestamp. and your insert is incorrect
mysql_query("INSERT INTO chat (Name, Date, Content, Time)
VALUES ('fTxt')"); //insert
your inserting ftxt to where? it should be
mysql_query("INSERT INTO chat (Name, Date, Content, Time)
VALUES ('your_name','the_date','your_content','the_time')")// just a sample