Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/10/2008, 13:46
yombilait
 
Fecha de Ingreso: octubre-2008
Mensajes: 11
Antigüedad: 15 años, 6 meses
Puntos: 0
Error de redireccion en formulario con dreamweaver

Hola amigos, estoy empezando con dreamweaver y cada paso es un parto, ya tuve como 15 hijos. ja ja.
el tema me tiene mal hace 2 dias, y es bastante comun por lo que veo en el foro, pero la solucion no la encuentro, y eso que probe de todo.
tengo una pagina de registro que luego de ingresar este, se tendria que redireccionar a confirmaregistro.php pero no lo hace, pruebo con otro sitio y si lo hace. el script es igual (salvo los nombres de las pag. db y conex.) no le encuentro la vuelta, y no es la primera vez que DW scripta mal y tengo que modificarlo, asi que aca mando el script php:

<?php virtual('/Connections/registrousuarios.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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"] == "formuregistro")) {
$insertSQL = sprintf("INSERT INTO usuarios (nomape, nic, con, ema, cat) VALUES (%s, %s, %s, %s, %s)",
GetSQLValueString($_POST['nomape'], "text"),
GetSQLValueString($_POST['nic'], "text"),
GetSQLValueString($_POST['con'], "text"),
GetSQLValueString($_POST['ema'], "text"),
GetSQLValueString($_POST['cat'], "text"));

mysql_select_db($database_registrousuarios, $registrousuarios);
$Result1 = mysql_query($insertSQL, $registrousuarios) or die(mysql_error());

$insertGoTo = "/confirmaregistro.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
mysql_select_db($database_registrousuarios, $registrousuarios);
$query_registrousuarios = "SELECT * FROM usuarios";
$registrousuarios = mysql_query($query_registrousuarios, $registrousuarios) or die(mysql_error());
$row_registrousuarios = mysql_fetch_assoc($registrousuarios);
$totalRows_registrousuarios = mysql_num_rows($registrousuarios);
?>

y aca esta la parte del formulario html:

<table width="478" border="1">
<tr>
<td width="468" height="116" colspan="3"><form id="formuregistro" name="formuregistro" method="POST" action="<?php echo $editFormAction; ?>">
&nbsp;
Nombre y apellido
<label>
<input name="nomape" type="text" id="nomape" size="30" maxlength="50" />
</label>
<p>&nbsp; Nic de usuario
<label>
<input name="nic" type="text" id="nic" size="20" maxlength="20" />
</label>
</p>
<p> &nbsp;
Contrase&ntilde;a
<label>
<input name="con" type="password" id="con" size="10" maxlength="10" />
</label>
</p>
<p>&nbsp; Email
<label>
<input name="ema" type="text" id="ema" size="30" maxlength="50" />
<br />
<input name="cat" type="hidden" id="cat" value="com" />
<input name="fec" type="hidden" id="fec" />
<br />
<br />
<input type="submit" name="Submit2" value="Enviar" />
<br />
</label>
<input type="hidden" name="MM_insert" value="formuregistro" />
</p>
</form> </td>
</tr>
</table>

esta hecho con plantilla, pero eso lo saque, solo deje lo esencial.

Bueno, espero que alguien me pueda ayudar. Saludos.