Ver Mensaje Individual
  #2 (permalink)  
Antiguo 08/02/2008, 07:36
Avatar de T4ke0veR
T4ke0veR
 
Fecha de Ingreso: agosto-2007
Ubicación: Quito - Ecuador
Mensajes: 1.720
Antigüedad: 16 años, 8 meses
Puntos: 28
Re: Tomar primer item de la lista en menu de seleccion

Les dejo la declaracion y el form.... por falta d espacio


Código PHP:
<?php require_once('Connections/listproduc.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$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_listproduc$listproduc);
$query_Recordset1 "SELECT nombre FROM producto ORDER BY PKID ASC";
$Recordset1 mysql_query($query_Recordset1$listproduc) or die(mysql_error());
$row_Recordset1 mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 mysql_num_rows($Recordset1);
?>


<form action="email3.php" method="post" name="formulariocontact" id="form1" onsubmit="MM_validateForm('email','','RisEmail','telefono','','RisNum');return document.MM_returnValue">
<br />
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="2">
                       <tr>
                         <td width="27%" class="descPROD"><div align="left">Nombre <span class="style17 style5">(*) </span></div></td>
                         <td colspan="2"><div align="left" class="style12">
                             <input name="nombre" type="text"/>
                        &nbsp; </div></td>
                       </tr>
                       <tr>
                         <td class="descPROD">Apellido</td>
                         <td colspan="2"><span class="style12">
                           <label>
                           <input type="text" name="apellido" id="apellido" />
                           </label>
                         &nbsp;</span></td>
                       </tr>
                       <tr>
                         <td class="descPROD">Empresa</td>
                         <td colspan="2"><span class="style12">
                           <label>
                           <input type="text" name="empresa" id="empresa" />
                           </label>
                        &nbsp; </span></td>
                       </tr>
                       <tr>
                         <td class="descPROD">RIF/C.I <span class="style17 style5">(*)</span></td>
                         <td width="20%"><div align="left" class="style12">
                             <label>
                             <select name="tipo" class="style12" id="tipo">
                               <option>V</option>
                               <option>E</option>
                               <option>J</option>
                             </select>
                             </label>
                         </div></td>
                         <td width="53%"><div align="left">
                           <input name="rif" type="text" id="rif" size="13" />
                         &nbsp;</div></td>
                       </tr>
                       <tr>
                         <td valign="top" class="descPROD">Dirección</td>
                         <td colspan="2"><span class="style12">
                           <label>
                           <textarea name="direccion" id="direccion" cols="17" rows="3"></textarea>
                           </label>
                         &nbsp;</span></td>
                       </tr>
                       <tr>
                         <td class="descPROD"><div align="left">E-Mail <span class="style17 style5">(*)</span></div></td>
                         <td colspan="2"><input name="email" type="text" id="email" />&nbsp;</td>
                         </tr>
                       <tr>
                         <td class="descPROD"><div align="left">Tel&eacute;fono<span class="style17 style5">(*)</span></div></td>
                         <td colspan="2"><div align="left" class="style12">
                           <input name="telefono" type="text" id="telefono" onblur="MM_validateForm('email','','RisEmail','telefono','','RisNum');return document.MM_returnValue" />
                         &nbsp;</div></td>
                       </tr>
                       <tr>
                         <td class="descPROD"><div align="left">Producto<span class="style5">(*)</span></div></td>
                         <td colspan="2"><div align="left">
                           <label></label>
                         <label for="productos"></label>
  <select name="productos" class="style1" id="productos">
    <?php
do {  
?>
    <option value="<?php echo $row_Recordset1['nombre']?>"<?php if (!(strcmp($row_Recordset1['nombre'], $row_Recordset1['nombre']))) {echo "selected=\"selected\"";} ?>><?php echo $row_Recordset1['nombre']?></option>
    <?php
} while ($row_Recordset1 mysql_fetch_assoc($Recordset1));
  
$rows mysql_num_rows($Recordset1);
  if(
$rows 0) {
      
mysql_data_seek($Recordset10);
      
$row_Recordset1 mysql_fetch_assoc($Recordset1);
  }
?>
  </select>
                        &nbsp; </div></td>
                       </tr>
                       <tr>
                         <td valign="top" class="descPROD"><div align="left">Comentarios</div></td>
                         <td colspan="2"><div align="left" class="style12">
                           <label>
                           <textarea name="comentarios" id="comentarios" cols="17" rows="5"></textarea>
                           </label>
                         &nbsp;</div></td>
                       </tr>
                       <tr>
                         <td><div align="left"></div></td>
                         <td colspan="2"><div align="left">
                             <input name="Submit" type="submit" class="descPROD" value="Enviar" />
                             <input name="Submit2" type="submit" class="descPROD" value="Borrar" />
                         &nbsp;</div></td>
                       </tr>
                       <tr>
                         <td colspan="3"><div align="left"><br />
                                 <span class="textoQUIENES"><span class="style5">(*)</span> Campos requeridos. </span><br />
                                 <br />
                         </div></td>
                       </tr>
                     </table>&nbsp;
                     <div align="left"></div>
                   </form>
Gracias
__________________
Diseño gráfico, Web, imagen corporativa, publicidad ...