Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/05/2011, 13:02
isabellawebs
Usuario no validado
 
Fecha de Ingreso: diciembre-2009
Ubicación: Bogotá
Mensajes: 462
Antigüedad: 14 años, 4 meses
Puntos: 18
Cómo enviar este formulario con combo desde el boton?

No he podido solucionar esto. Pido toda la ayuda posible.

Lo he intentado todo. Por favor una orientación

Código PHP:
<?php require_once('Connections/citasjoya.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;
}
}

mysql_select_db($database_citasjoya$citasjoya);
$query_rc_tipo "SELECT * FROM tablatipotramites";
$rc_tipo mysql_query($query_rc_tipo$citasjoya) or die(mysql_error());
$row_rc_tipo mysql_fetch_assoc($rc_tipo);
$totalRows_rc_tipo mysql_num_rows($rc_tipo);

$colname_rc_hora "-1";
if (isset(
$_POST['idtramite'])) {
  
$colname_rc_hora $_POST['idtramite'];
 } 
mysql_select_db($database_citasjoya$citasjoya);
$query_rc_fecha "SELECT * FROM tablafechas";
$rc_fecha mysql_query($query_rc_fecha$citasjoya) or die(mysql_error());
$row_rc_fecha mysql_fetch_assoc($rc_fecha);
$totalRows_rc_fecha mysql_num_rows($rc_fecha);

$colname_rc_hora "-1";
if (isset(
$_POST['idfecha'])) {
  
$colname_rc_hora $_POST['idfecha'];
}
mysql_select_db($database_citasjoya$citasjoya);
$query_rc_hora sprintf("SELECT idhora, hora FROM tablahoras WHERE idfecha = %s"GetSQLValueString($colname_rc_hora"int"));
$rc_hora mysql_query($query_rc_hora$citasjoya) or die(mysql_error());
$row_rc_hora mysql_fetch_assoc($rc_hora);
$totalRows_rc_hora mysql_num_rows($rc_hora);
?>
<!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>Sitio para  solicitud de tablacitas</title><link rel="shortcut icon" href="favicon.ico" />
<link type="text/css" rel="stylesheet" href="css/joya.css" />
</head>

<body>
<div align="center">
  <table width="1024" border="0">
    <tr>
      <td width="507"><a href="index.php" target="_self"><img src="images/logo_joya.png" width="249" height="70" alt="Joya Pabón" /></a></td>
      <td width="507">&nbsp;</td>
    </tr>
    <tr>
      <td align="left" valign="middle">&nbsp;</td>
      <td align="center" valign="middle">&nbsp;</td>
    </tr>
    <tr>
      <td align="left" valign="middle"><p class="textogrande">Hola , <br />
      Saca tu cita!</p>
      <p class="textomediano">Selecciona la fecha y tablahoras en que quieres visitarnos.</p>
      <p class="textomediano">Para nosotros, eres lo mas importante.</p></td>
      <td align="center" valign="middle"><div align="center"><form id="form1" name="form1" method="post" action="">
        <table width="60" border="0">
        <table width="194" border="0">
                <tr>
                  <td class="etiquetas">Fecha</td>
                  <td><select name="idfecha" class="campos" id="idfecha" onchange="submit()">
                    <option value="" <?php if (!(strcmp(""$_POST['idfecha']))) {echo "selected=\"selected\"";} ?>>Fecha</option>
                    <?php
do {  
?>
                    <option value="<?php echo $row_rc_fecha['idfecha']?>"<?php if (!(strcmp($row_rc_fecha['idfecha'], $_POST['idfecha']))) {echo "selected=\"selected\"";} ?>><?php echo $row_rc_fecha['fecha']?></option>
                    <?php
} while ($row_rc_fecha mysql_fetch_assoc($rc_fecha));
  
$rows mysql_num_rows($rc_fecha);
  if(
$rows 0) {
      
mysql_data_seek($rc_fecha0);
      
$row_rc_fecha mysql_fetch_assoc($rc_fecha);
  }
?>
                  </select></td>
                </tr>
                <tr>
                  <td class="etiquetas">Hora</td>
                  <td><select name="idhora" class="campos" id="idhora">
                    <option value="" <?php if (!(strcmp(""$_POST['idhora']))) {echo "selected=\"selected\"";} ?>>Hora</option>
                    <?php
do {  
?>
                    <option value="<?php echo $row_rc_hora['idhora']?>"<?php if (!(strcmp($row_rc_hora['idhora'], $_POST['idhora']))) {echo "selected=\"selected\"";} ?>><?php echo $row_rc_hora['hora']?></option>
                    <?php
} while ($row_rc_hora mysql_fetch_assoc($rc_hora));
  
$rows mysql_num_rows($rc_hora);
  if(
$rows 0) {
      
mysql_data_seek($rc_hora0);
      
$row_rc_hora mysql_fetch_assoc($rc_hora);
  }
?>
                  </select></td>
                </tr>
                <tr>
                  <td class="etiquetas">&nbsp;</td>
                  <td><input type="submit" name="enviar" id="enviar" value="Enviar" /> 
                </tr>
          </table>
          <tr>
            <input type="hidden" name="MM_insert" value="form1" />
          </form>
      </td>
    </tr>
    <tr>
      <td align="left" valign="middle">&nbsp;</td>
      <td align="center" valign="middle">&nbsp;</td>
    </tr>
    <tr>
      <td height="219" colspan="2" align="center" valign="bottom"><a href="#" target="_blank" class="texto"></a> - <a href="http://www.isawebs.net" target="_blank" class="texto">Dise&ntilde;o y programaci&oacute;n <img src="images/logotrans.png" width="55" height="35" alt="isawebs.net" /></a></td>
    </tr>
  </table>
</div>
<tr>
  <td height="230" colspan="2" align="center" valign="bottom">&nbsp;</td>
    </tr>
</body>
</html>
<?php
mysql_free_result
($rc_fecha);

mysql_free_result($rc_hora);

mysql_free_result($rc_tipo);
?>