MySQL
Mira tengo 2 paginas: ingresar_MSGs.php y MSGs.php
ingresar_MSGs.php:
<form name="form1" method="post" action="MSGs.php">
<p> Nombre:
<input type="text" name="nombre">
</p>
<p>Email:
<input type="text" name="email">
</p>
<p>Mensaje:</p>
<p>
<textarea name="msg" cols="100" rows="30"></textarea>
</p>
<p><input type="submit" name="Submit" value="Ingresar">
</p>
</form>
MSGs.php:
<?php
$direccion=getenv("SERVER_ADDR");
$link=mysql_pconnect($direccion,"xxx","xxxx");
echo mysql_errno().": ".mysql_error()."<BR>";
mysql_select_db("pagina",$link);
$n = addslashes(trim($nombre));
$m= addslashes(trim($msg));
$e = addslashes(trim($email));
$result=mysql_query("INSER INTO mensajes VALUES('$n','$m','$e')",$link);
mysql_close($link);
?>
El tema es q ni siquiera me crea un registro en blanco, todo mal!!!
Te agradeceria mucho si me pudiera ayudar.. estoy a punto de volverme loco(mas de lo q estoy )
salu2
ingresar_MSGs.php:
<form name="form1" method="post" action="MSGs.php">
<p> Nombre:
<input type="text" name="nombre">
</p>
<p>Email:
<input type="text" name="email">
</p>
<p>Mensaje:</p>
<p>
<textarea name="msg" cols="100" rows="30"></textarea>
</p>
<p><input type="submit" name="Submit" value="Ingresar">
</p>
</form>
MSGs.php:
<?php
$direccion=getenv("SERVER_ADDR");
$link=mysql_pconnect($direccion,"xxx","xxxx");
echo mysql_errno().": ".mysql_error()."<BR>";
mysql_select_db("pagina",$link);
$n = addslashes(trim($nombre));
$m= addslashes(trim($msg));
$e = addslashes(trim($email));
$result=mysql_query("INSER INTO mensajes VALUES('$n','$m','$e')",$link);
mysql_close($link);
?>
El tema es q ni siquiera me crea un registro en blanco, todo mal!!!
Te agradeceria mucho si me pudiera ayudar.. estoy a punto de volverme loco(mas de lo q estoy )
salu2
<?php
include("ingresar_MSGs.php");
$n=addslashes($nombre);
$e=addslashes($mail);
$m=addslashes($msg);
$sql = "INSERT INTO registro VALUES
( '$nombre', '$mail',, '$msg')";
}
if ( $respuesta=enviar_sql($db, $sql))
{
include("registro_ingresado.htm");
$archivo = fopen("registro_ingresado.htm", "r");
readfile($archivo);
}
else
{
include("registro_anulado.htm");
$archivo2= fopen("registro_anulado.htm", "r");
readfile($archivo2);
}
?>
include("ingresar_MSGs.php");
$n=addslashes($nombre);
$e=addslashes($mail);
$m=addslashes($msg);
$sql = "INSERT INTO registro VALUES
( '$nombre', '$mail',, '$msg')";
}
if ( $respuesta=enviar_sql($db, $sql))
{
include("registro_ingresado.htm");
$archivo = fopen("registro_ingresado.htm", "r");
readfile($archivo);
}
else
{
include("registro_anulado.htm");
$archivo2= fopen("registro_anulado.htm", "r");
readfile($archivo2);
}
?>
