Allora io ho il pulsante invio di un form in flash-mx che recita cosi:
///////
on (release)
{
errorMsg.text = ''
if((username.length > 0 && username.length < 10)
&& (password.length > 0 && password.length < 10)
&& (email.length > 0)
&& (nome.length > 0)
&& (cognome.length > 0))
{
var regVars = new LoadVars();
regVars.action = 'register';
regVars.username = username.text;
regVars.password = password.text;
regVars.email = email.text;
regVars.telefono = telefono.text;
regVars.country = country.text;
regVars.college = college.text;
regVars.nome = nome.text;
regVars.cognome = cognome.text;
regVars.sendAndLoad("signup.php", regVars, 'POST');
sendd.enabled = false;
regVars.onLoad = function()
{
if(this.error != undefined)
{
errorMsg.text = this.error;
} else {
_root.gotoAndStop('congratulations');
}
sendd.enabled = true;
}
}
}
////////
ed il file php di rif. che rcita in questo modo...
<?
require_once('conf.inc.php');
require_once('functions.php');
// ---
// register new user
// ---
function register($log,$pwd,$email,$nome,$cognome,$country, $college,$telefono)
{
GLOBAL $db, $table;
$username = trim($log);
$password = trim($pwd);
$email = trim($email);
$nome = trim($nome);
$cognome = trim($cognome);
$country = trim($country);
$college = trim($college);
$validEmail = valid_email($email);
$validName = valid_userName($username);
$validPass = valid_password($pwd);
if(!$validName) return "error=invalid name";
if(!$validPass) return "error=invalid password";
if(!$validEmail) return "error=invalid email";
// all checks ok
$query = @mysql_query("INSERT INTO $table (username,password,email,nome,cognome,country,coll ege) VALUES "
."('$log','$pwd','$email','$nome','$cognome','$cou ntry','$college')");
if(!$query)
{
return "error=" . mysql_error();
} else {
return "user=ok";
}
}
?>
Mi domando: i due attori daranno vita ad uno spettacolo o ad un fiasco totale?

Rispondi quotando