Foros del Web » Programando para Internet » PHP »

encuestador en php ayuda

Estas en el tema de encuestador en php ayuda en el foro de PHP en Foros del Web. hola a todos tengo el siguiete problema: o puedo hacer que mi encuestador despues de respoder vaya a otra pagia, es decir cuando el usuario ...
  #1 (permalink)  
Antiguo 13/08/2008, 10:09
 
Fecha de Ingreso: mayo-2008
Mensajes: 148
Antigüedad: 15 años, 11 meses
Puntos: 1
encuestador en php ayuda

hola a todos tengo el siguiete problema: o puedo hacer que mi encuestador despues de respoder vaya a otra pagia, es decir cuando el usuario haga clik en aceptar deveria ir a otra pagina pero no me resulta, aqui les dejo el codigo, espero puedan ayudarme
Código PHP:
<?php require_once('../Connections/xxxxxx.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"] == "form1")) {
  
$insertSQL sprintf("INSERT INTO encuesta (sex) VALUES (%s)",
                       
GetSQLValueString($_POST['sexo'], "text"));

  
mysql_select_db($database_xxxxxxx$xxxxxx);
  
$Result1 mysql_query($insertSQL$xxxxxxx) or die(mysql_error());

  
$insertGoTo $_GET['lugar'];
  if (isset(
$_SERVER['QUERY_STRING'])) {
    
$insertGoTo .= (strpos($insertGoTo'?')) ? "&" "?";
    
$insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  
header(sprintf("Location: %s"$insertGoTo));
}
?><!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>

<body> 
<form action="<?php echo $editFormAction?>" method="POST" enctype="application/x-www-form-urlencoded" name="form1" id="form1">
  <p>Seleccione su Sexo:</p>
  <p>
    <input name="sexo" type="radio" value="Femenino" onclick="document.form1.boton.disabled=false"/>
    Femenino
    <input name="sexo" type="radio" value="Masculino" onclick="document.form1.boton.disabled=false"/>
    Masculino
  </p>
  <p>
    <label>
    <input type="submit" name="Submit" id="boton" value="Aceptar" disabled="disabled" />
    </label>
</p>
  <input type="hidden" name="MM_insert" value="form1">
</form>
</body>
</html>
no doy para mas, de anteano gracias
  #2 (permalink)  
Antiguo 13/08/2008, 14:28
Avatar de TolerantX  
Fecha de Ingreso: marzo-2006
Ubicación: Guadalajara, México.
Mensajes: 408
Antigüedad: 18 años, 1 mes
Puntos: 10
Respuesta: encuestador en php ayuda

Código PHP:
$insertGoTo $_GET['lugar']; 
En ésta variable debe de ir a la página que quieres que se redireccione y a lo que veo dónde está el valor de $_GET['lugar'] ?
__________________
TolerantX
http://tolerantx.com
Linux User #385226
  #3 (permalink)  
Antiguo 13/08/2008, 17:05
 
Fecha de Ingreso: mayo-2008
Mensajes: 148
Antigüedad: 15 años, 11 meses
Puntos: 1
Respuesta: encuestador en php ayuda

Respuesta: encuestador en php ayuda

--------------------------------------------------------------------------------
Código PHP:
$insertGoTo = $_GET['lugar'];

En ésta variable debe de ir a la página que quieres que se redireccione y a lo que veo dónde está el valor de $_GET['lugar'] ?
__________________
TolerantX
http://tolerantx.com
Linux User #385226

si es verdad me esta sobrando el $_GET['lugar'] hay va la pagina a la cual quiero que vaya despues de hacer clit en aceptar jeje gracias estaba bloqueado

respuesta:

antes:
Cita:
$insertGoTo = $_GET['lugar'];
ahora:
Cita:
$insertGoTo = 'pagina_destino.php' ;
TolerantX muchas gracias por abrirme los ojos
  #4 (permalink)  
Antiguo 13/08/2008, 21:23
Avatar de TolerantX  
Fecha de Ingreso: marzo-2006
Ubicación: Guadalajara, México.
Mensajes: 408
Antigüedad: 18 años, 1 mes
Puntos: 10
Respuesta: encuestador en php ayuda

De nada amigo, son problemas que suelen suceder y pues para eso estamos, para apoyarnos :)
__________________
TolerantX
http://tolerantx.com
Linux User #385226
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 00:21.