Mojan,
Try the following code:
<?php
$host = "mysql.mynetkeepers.ca";
$user = "Your MySQL user name";
$password = "Your MySQL password";
$database = "mojo_comments";
$comments_name = $_POST[comments_name];
$comments_text = $_POST[comments_text];
$comments_date = date("Y-m-d");
$connect = @mysql_connect($host, $user, $password) or die("result=Unable to
connect!");
$db = mysql_select_db($database);
$query = "INSERT INTO comments (comments_name, comments_text, comments_date)
VALUES ('$comments_name', '$comments_text', '$comments_date')";
$result = mysql_query($query,$connect) or
die("result=".mysql_error($connect));
echo "result=OK";
mysql_close($connect);
?>
ActionScript Code:
on (release) {
if (commentsName == "") {
error = "Enter Name!";
} else if (comments == "") {
error = "Enter Comments!";
} else {
var myDataResponse:LoadVars = new LoadVars();
var myData:LoadVars = new LoadVars();
myData.comments_name = commentsName;
myData.comments_text = comments;
myData.sendAndLoad("
http://www.mediaxweb.com/record.php", myDataResponse,
"POST");
myDataResponse.onLoad = function() {
if (this.result == "OK") {
error = "Comments have been submitted!";
commentsName = "";
comments = "";
} else {
error = this.result;
}
};
}
}