all'interno di un mc sullo stage ho un pulsante con
on (press){
create = new LoadVars();
create._root.table.eventname = _root.table.eventname.text;
create._root.table.tabnameinput = _root.table.tabnameinput.text;
create._root.table.tabcodeinput = _root.table.tabcodeinput.text;
create._root.table.username4 = _root.table.username4.text;
create._root.table.password4 = _root.table.password4.text;
create._root.table.stato = _root.table.stato.text;
create.sendAndLoad("create.php?stato=",create, "POST");
create.onLoad =function (success){
if (success){
gotoAndStop(5);
} else {
gotoAndStop(6);
}
}
}
il php è
<?php
require ('conf.inc3.php');
$stato = $_POST ["stato"];
$eventname = $_POST ["eventname"];
$tabnameinput = $_POST ["tabenameinput"];
$tabcodeinput = $_POST ["tabcodeinput"];
$username4 = $_POST ["username4"];
$password4 = $_POST ["password4"];
$query = "
INSERT INTO $table (usercreate, pwdcreate, nometavolo, codetavolo, evento)
VALUES ('$username4', '$password4', '$tabnameinput', '$tabcodeinput', '$eventname')
";
mysql_query($query);
$msg1='Thank you, table created';
$msg2='Server error, try later!';
if ($query)
{
print '&stato='.$msg1;
} else {
print '&stato='.$msg2;
}
?>
Non mi inserisce il record nel db, eppure ho replicato un altra form funzionante che ho però sulla _root!!!
Se qualcuno trova l'errore ringrazio!
![]()