
****EN PHP****
Código PHP:
<?
$a=1;
if(a==1)
{
$HOSTNAME = "localhost";//SERVIDOR
$USERNAME = "root"; //USUARIO
$PASSWORD = "una"; //CONTRASEÑA
$DATABASE = "tutorialxl"; //BASE DE DATOS
//nos conectamos a mysql.
function conectar(){
global $HOSTNAME,$USERNAME,$PASSWORD,$DATABASE;
$idcnx = mysql_connect($HOSTNAME, $USERNAME, $PASSWORD) or DIE(mysql_error());
mysql_select_db($DATABASE, $idcnx);
return $idcnx;
}
$cnx = conectar ();
$campos = "nombre,pais,email";
$valores = "'".$_POST['nombre']."',";
$valores .= "'".$_POST['apellido']."',";
$valores .= "'".$_POST['email']."',";
$sql = "INSERT INTO email ($campos) VALUES($valores)";
$res = mysql_query($sql) or die(mysql_error());
echo "<&elTexto1=Registro ingresado&";
mysql_close($cnx);
}
else {
echo "&elTexto1=Registro no ingresado&";
mysql_close($cnx);
}
echo "&estatus=ok&";
?>
enviar.onRelease = function(){
lv = new LoadVars();
lv.nombre = nombre.text;
lv.email = email.text;
lv.pais = pais.text;
lv.sendAndLoad("http://localhost/07/nuevo.php", lv, "POST");
elTexto.text = "enviando mensaje";
nombre.text = " ";
email.text = " ";
pais.text = " ";
lv.onLoad = function() {
if (this.estatus == "ok") {
elTexto.text = "Tu mensaje fue enviado. nGracias.... =)";
nombre.text = " ";
email.text = " ";
pais.text = " ";
elTexto.text = "devuelto de php:\n\n"+
"Nombre: "+lv["nombre"]+"\n"+
"email:"+lv["email"]+"\n"+
"pais:"+lv["pais"];
elTexto1.text = " "+
"elTexto1:"+lv["elTexto1"]+"\n"+
"estatus:"+lv["estatus"];
} else {
elTexto.text = "Problemas con el servidornIntentalo de Nuevo";
}
}
};
LO MAS PROBABLE ES QUE SEA ALGUNA TONTERÍA


GRACIAS!