Ok lo subo otra vez:
Archivos PHP:
registro.php
Código PHP:
Ver original<html>
<head>
<title>Registro de usuario</title>
</head>
<body>
<h1>Registro usuario</h1>
<h3>Los campos con (*) son obligados.</h3>
<form method="POST" action="registro2.php">
<table>
<tr>
<td>
*Nombre y apellidos:
</td>
<td>
<input type="text" name="realname"/>
</td>
</tr>
<tr>
<td>
*Contraseña:
</td>
<td>
<input type="password" name="clave"/>
</td>
</tr>
<tr>
<td>
*Repetir Contraseña:
</td>
<td>
<input type="password" name="rclave"/>
</td>
</tr>
<tr>
<td>
Correo eléctrónico:
</td>
<td>
<input type="text" name="correo"/>
</td>
</tr>
</table>
<input type="submit" name="submit" value="Registrarme"/> <input type="reset"/>
</form>
</body>
</html>
registro2.php
Código PHP:
Ver original<?php
$realname = $_POST ['realname'];
$clave = $_POST ['clave'];
$rclave = $_POST ['rclave'];
$correo = $_POST ['correo'];
if($reqlen > 0){
if($clave == $rclave){
require("connect_db.php");
//$sql= "INSERT INTO formulario (Nombre, Clave, Correo) VALUES (" . $realname ." , " . $clave . ", " .$correo . ")";
$sql= "INSERT INTO formulario (Nombre, Clave, Correo) VALUES ('" . $realname ."' , '" . $clave . "', '" .$correo . "')";
} else {
echo 'Debe introducir dos contraseñas identicas';
}
} else {
echo 'Por favor, rellene todos los campos requeridos';
}
?>
?>
Base de datos:
TAKECAREtakecareEXPORT.sql
Código SQL:
Ver original-- phpMyAdmin SQL Dump
-- version 3.3.9
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 24-05-2013 a las 12:23:45
-- Versión del servidor: 5.5.8
-- Versión de PHP: 5.3.5
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Base de datos: `takecare`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `formulario`
--
DROP TABLE IF EXISTS `formulario`;
CREATE TABLE IF NOT EXISTS `formulario` (
`idForm` INT(10) NOT NULL AUTO_INCREMENT,
`Nombre` VARCHAR(30) NOT NULL,
`Clave` VARCHAR(15) NOT NULL,
`Correo` VARCHAR(30) NOT NULL,
PRIMARY KEY (`idForm`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Volcar la base de datos para la tabla `formulario`
--
Aquí lo tienes la linea que me comentaste que estaba mal esta comentada // he hecho la corrección con las comillas que me dijiste debajo de la que tenia mal.