Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/09/2003, 17:04
KillerBKS
 
Fecha de Ingreso: julio-2002
Ubicación: Rancagua - Chile
Mensajes: 494
Antigüedad: 21 años, 9 meses
Puntos: 0
Todavia tengo problemas

Estoy tratando de llenar un combo box con los nombres de usuarios. Este combo se llena bien, pero lo que trato de hacer es recuperar el "id" de ese usuario seleccionado en el combo box, pero no logro recuperarlo desde otro archivo php.
Aqui estan los codigos del archivo en donde lleno el combo box (nuevo.php), el archivo en donde lo recupero (validar.php) y tambien incluyo la estructura de la tabla que estoy usando.


Nuevo.php
<?
// Aqui hago la conexion con la base de datos

require "../include/global_login.php";
?>
<html>
<head>
<title>Mensajes a Usuarios</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="STYLESHEET" type="text/css" href="../estilos.css">
</head>

<body leftmargin="0" topmargin="0" marginwidth="0">
<table width="320" height="340" border="1" align="center" cellspacing="0">
<tr>
<td height="46" colspan="3" valign="top">
<table width="100%" border="0" cellspacing="0" background="../images/fonditoforotop.gif">
<tr>
<td valign="top" class="titulo"><div align="left"><img src="../images/chat1.gif" width="58" height="50">
Reuniones y Citas On-line</div></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="3" valign="top"> <table width="100%" border="0" cellspacing="0">
<tr>
<td width="98%" height="20" bgcolor="#5c60a5"><b class="foroplat">Complete
los Siguientes Campos:</b></td>
<td width="2%" valign="top" bgcolor="#5c60a5"> <div align="right"><img src="../images/esqizsup.gif" width="18" height="18"></div></td>
</tr>
</table>
<table width="100%" height="249" border="0" cellspacing="0">
<tr bgcolor="#A8EAFF">
<td height="0" valign="top" bgcolor="#FFFFFF">
<form name="form1" method="post" action="">
<table width="100%" border="0" cellspacing="0">
<tr bgcolor="#A8EAFF">
<td height="20"> <div align="left"><img src="../images/fl.gif" width="5" height="10" border="0">
<select name="usuario" id="usuario">
<option value="0" selected>Seleccione desde aqu&iacute;
en nombre de usuario</option>
<?
$consulta=mysql_query("select * from users");
while ($row=mysql_fetch_array($consulta))
{
?>
<option><? echo $row["firstname"] ?></option>
<? } ?>
</select>
</div></td>
</tr>
</table>
<br>
<table width="100%" border="0" cellspacing="0">
<tr bgcolor="#A8EAFF">
<td height="0" bgcolor="#FFFFFF">
<div > <strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Asunto:</font></strong><br>
<input name="textfield" type="text" size="30" maxlength="30">
</div></td>
</tr>
</table>
<br>
<table width="100%" border="0" cellspacing="0">
<tr bgcolor="#A8EAFF">
<td height="0" bgcolor="#FFFFFF">
<div > <strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Escriba
aqu&iacute; su Mensaje:</font></strong><br>
<textarea name="textarea" cols="30" rows="6"></textarea>
</div></td>
</tr>
</table>
<table border=0 cellspacing=0 cellpadding=1 width="100%">
<tr>
<td width="99%" height="21" bgcolor="#5c60a5" class="mainwhite">
&nbsp; <img src="../images/fl.gif" width="5" height="10" border=0>
<b class="foroplat"><a href="https://www.ueubiobio.cl/evcdesarrollo/mensajes/validar.php">Enviar
Ahora</a></b></td>
<td width="1%" bgcolor="#5c60a5" class="mainwhite"> <div align="right"><img src="../images/esderinf.gif" width="18" height="19"></div></td>
</tr>
</table>
</form>
</td>
</tr>
</table></td>
</tr>
</table>
<div align="center"></div>
<div align="center"></div>
</body>
</html>


Validar.php

<HTML>
<HEAD>
<TITLE>Grabar Noticias</TITLE>
</HEAD>

<BODY>
<?

$user= $HTTP_GET_VARS['usuario'];
echo "ACA....."; echo $user;


?>
<p>&nbsp;</p>
<p><font face="Verdana, Arial, Helvetica, sans-serif">Su Noticia ha sido agregada...</font></p>
<p><a href="courses/head_admin.php?courses=<? echo $id_curso ?>"><font face="Verdana, Arial, Helvetica, sans-serif">Volver</font></a></p>
</BODY>
</HTML>

tabla users

Tabla users

id
active
login
password
firstname
surname
email
homepage
picture
admin
address
comuna
info
lastlogin
icq
tipousuario
creadopor
cuota_usada
nivelusuario
establec
fechacreado
fono


Espero ser claro y que alguien me ayude......

Salu2