el codigo completo del .php es:
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="es" xml:lang="es">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Xgames-Prueba</title>
</head>
<body>
<?php
$host="localhost";
$user="root";
$password="";
$link = mysql_connect ($host, $user, $password) or die ("No se puede conectar con la base de datos");
mysql_select_db("usuarios",$link);
mysql_query("INSERT INTO datos (nombre,pass,email)
VALUES ('{$_POST['nombre']}','{$_POST['pass']}','{$_POST['email']}')",$link);
$my_error = mysql_error($link);
if(!empty($my_error)) {
echo "Ha habido un error al insertar los valores. $my_error";
}
else{
echo "El ingreso fue un exito";
}
?>
<div align="center">
Formulario de <strong>registro</strong><br />
<form action="prueba.php" method="post"><br />
Nombre:<input type="text" name="nombre" maxlength="20"/> <br />
Email:<input type="text" name="email" maxlength="20"/><br />
Contraseña:<input type="text" name="pass" maxlength="20"/><br />
<input type="submit" name="enviar" value="Registro"/>
</form>
</div>
</body>
</html>