Lo he vuelto a hacer pero me sigue sin funcionar.
index.html Código HTML:
<div id="apDiv1">
<form id="form1" name="form1" method="post" action="procesar.php">
<table width="250" border="0">
<tr>
<td width="77">email</td>
<td width="413"><label>
<input type="text" name="email" id="email" />
</label></td>
</tr>
<tr>
<td>nombre</td>
<td><label>
<input type="text" name="nombre" id="nombre" />
</label></td>
</tr>
<tr>
<td>pais</td>
<td><label>
<input type="text" name="pais" id="pais" />
</label></td>
</tr>
<tr>
<td colspan="2"><label>
<input type="submit" name="enviar" id="enviar" value="Enviar" />
</label></td>
</tr>
</table>
</form>
</div>
conexion.php Código PHP:
<?php
$host = "miservidor";
$user = "miusuario";
$pw = "micontraseña";
$bd = "mibd";
?>
procesar.php Código PHP:
<?php
include("conexion.php");
if(isset($_POST['email']) && !empty($_POST['email']) &&
(isset($_POST['nombre']) && !empty($_POST['nombre']) &&
(isset($_POST['pais']) && !empty($_POST['pais']) &&
{
$conexion = mysql_connect($host,$user,$pw) or die("problema al conectar el host");
mysql_select_db($bd,$conexion) or die("problema al conectar la base de datos");
mysql_query("INSERT INTO tabla (EMAIL,NOMBRE,PAIS)
VALUES ('$_POST [email]','$_POST [nombre]','$_POST [pais]')",$conexion);
echo "datos insertados correctamente"
}else{
echo "problema al insertar datos";
}
?>
el codigo lo saque de ese
tutorial pero no me funciona