I have a little application with five text fields and a submit button that i want to put the inputted data from into a database. i have my database done and everything, and here is the code for the PHP file i’m using:
<?php
$server = "localhost";
$username = "reintro_matt";
$password = "*******";
$database = "reintro_testdb";
$table = "ecard";
mysql_pconnect($server, $username, $password);
mysql_select_db($database);
$success = 1;
$ins_str = "INSERT INTO " . $table . " VALUES ('".$HTTP_POST_VARS['fromName']."', '".$HTTP_POST_VARS['fromEmail']."', '".$HTTP_POST_VARS['toName']."', '".$HTTP_POST_VARS['toEmail']."', '".$HTTP_POST_VARS['message']."')";
//echo $ins_str;
if (!mysql_query ($ins_str)) {
$success = 0;
$msg = 'Problem saving records to the database';
} else {
$msg = 'Record was saved successfully. Refreshing display...';
}
echo '&success='.$success.'&msg='.$msg.'&';
?>
i’m not very good with PHP but after doing some research and reading some tutorials i think that is good to go. my text fields in flash have the variables that i’m using in the POST_VARS commands in PHP and similar instance names. how would i go about writing the actionscript to collect this data and insert it into the database in flash (or make corrections to the PHP i already have if it isn’t ready).
thanks in advance.