Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/10/2011, 05:28
fran1
 
Fecha de Ingreso: octubre-2011
Mensajes: 6
Antigüedad: 12 años, 6 meses
Puntos: 0
No se puede escribir en un formulario de registro

Hola
He creado el codigo de un formulario para registrarse en un foro.
Cuando hago una previsualización en LocalHost con Internet explorer 9 y Wampserver, la página de registro se visualiza correctamente pero no se puede escribir en la caja de texto. El cursor parpadea en la caja esperando la introducción de los caracteres pero no responde a ninguna pulsación del teclado.
He probado también con Google Chrome por si era un problema de Internet Explorer y el resultado es el mismo.
A continuación incluyo el código del formulario por si alguien es tan amable de ayudarme e indicarme donde está el fallo.

Gracias.

<?php require_once('Connections/foro.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "crear_usuario")) {
$insertSQL = sprintf("INSERT INTO usuarios (Usuario, Clave, Email) VALUES (%s, %s, %s)",
GetSQLValueString($_POST['Usuario'], "text"),
GetSQLValueString($_POST['Clave'], "text"),
GetSQLValueString($_POST['Email'], "text"));

mysql_select_db($database_foro, $foro);
$Result1 = mysql_query($insertSQL, $foro) or die(mysql_error());

$insertGoTo = "Index.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>

Y ESTE ES EL FORMULARIO EN SI:

<form id="crear_usuario" name="crear_usuario" method="POST" action="<?php echo $editFormAction; ?>">
<table width="200" border="1" cellspacing="2" cellpadding="4">
<tr>
<td>Nombre:</td>
<td><input type="text" name="Nombre" id="Nombre" /></td>
</tr>
<tr>
<td>Usuario:</td>
<td><input type="text" name="Usuario" id="Usuario" /></td>
</tr>
<tr>
<td>Clave:</td>
<td><input type="password" name="Clave" id="Clave" /></td>
</tr>
<tr>
<td>Email:</td>
<td><input type="Text" name="Email" id="Email" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="submit" name="button" id="button" value="Crear Usuario" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="crear_usuario" />
</form>