rempox
ho provato come mi hai consigliato tu ma niente....
Il file php è cosi
codice:
<?
require_once('conf.inc.php');
// ---
// Nuovo
// ---
function register($NomeFornitore,$Indirizzo,$Citt,$CAP,$Provincia,$Telefono,$Fax,$mail)
{
GLOBAL $db, $table;
$NomeFornitore = trim($NomeFornitore);
$Indirizzo = trim($Indirizzo);
$Citt = trim($Citt);
$Provincia = trim($Provincia);
$CAP = trim($CAP);
$Telefono = trim($Telefono);
$Fax = trim($Fax);
$mail = trim($mail);
$query = @mysql_query("INSERT INTO $table (NomeFornitore,Indirizzo,Citt,Provincia,CAP,Telefono,Fax,mail) VALUES "
."('$NomeFornitore','$Indirizzo','$Citt','$CAP','$Telefono','$Fax','$mail')");
if(!$query)
{
return "error=" . mysql_error();
} else {
return "user=ok";
}
}
if ( (isset($_POST['action'])) AND ($_POST['action'] == "register") )
{
register($_POST['NomeFornitore'], $_POST['Indirizzo'], $_POST['Citt'], $_POST['CAP'], $_POST['Provincia'], $_POST['Telefono'], $_POST['Fax'], $_POST['mail']);
}
print_r($_POST);
?>
il file flash
codice:
// ---
// PHP file
// ---
_global.php_file = "http://localhost/InsFornitori.php";
Stage.scaleMode = "noscale";
Inserimento.onRelease = function() {
errorMsg.text = "";
var regVars = new LoadVars();
regVars.action = "register";
regVars.nomefornitore = NomeFornitore.text;
regVars.indirizzo = Indirizzo.text;
regVars.citt = Citt.text;
regVars.cap = CAP.text;
regVars.telefono = Telefono.text;
regVars.fax = Fax.text;
regVars.mail = mail.text;
regVars.sendAndLoad(php_file, regVars, 'post');
Inserimento.enabled = false;
trace(regVars);
regVars.onLoad = function() {
if (this.error != undefined) {
errorMsg.text = this.error;
} else {
errorMsg.text = "OK";
trace("OK");
}
Inserimento.enabled = true;
};
};
ma anche se flash nel trace mi restituisce OK nel database non scrive nulla
il database è strutturato cosi
codice:
#
# Struttura della tabella `fornitori`
#
CREATE TABLE fornitori (
IDFornitore int(11) NOT NULL auto_increment,
NomeFornitore varchar(50) default NULL,
Indirizzo varchar(255) default NULL,
Città varchar(50) default NULL,
CAP varchar(20) default NULL,
Provincia varchar(20) default NULL,
Telefono varchar(30) default NULL,
Fax varchar(30) default NULL,
mail varchar(50) default NULL,
PRIMARY KEY (IDFornitore),
KEY CAP (CAP),
KEY mail (mail),
KEY NomeFornitore (NomeFornitore)
) TYPE=MyISAM;
perchè non scrive