I hope someone can help me out here..... I have made a member form in flash and
want the result to be added in mySQL database. (First name, address, place,
etc.)
When all the fields are filled in and you click the send button it?s checking
the required fields, when OK the form is send to the addmemeber.php file.
Flash code below:
on (release) {
if (firstname eq "" | address eq "" | place eq "" ) {
result = "You must fill in all required fields";
} else {
result = "Your membership has been send";
loadVariablesNum("addmemeber.php", 0, "POST");
}
}
OK, the output has been send to the php file addmember.php
PHP code below:
<?php
//Database connection
$dbhost = "localhost"; // database host
$dbuser = "root"; // database user
$dbpass = ""; // database password
$dbname = "dbname"; // database name
//Connect
$open = mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$firstname = $_POST["firstname"];
$address = $_POST["address"];
$place = $_POST["place"];
$query = mysql_query("INSERT INTO members (firstname, address, place)
VALUES ('$firstname', '$address', '$place')") or die (mysql_error());
?>
When I look into mySQL table nothing is added. :confused;
When I make a form in html/php with the same fields it's working. I can not
find out where I'm going wrong. Can someone help me out here.....