Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/07/2009, 20:19
lobbys
 
Fecha de Ingreso: junio-2009
Ubicación: lima
Mensajes: 139
Antigüedad: 14 años, 10 meses
Puntos: 0
pasar elementos de unaagina php a otra

hola:
el problema que tengo es el sgte.
tengo una tabla con una lista de elementos llena
Puse en ella la opcion seleccionar de tal manera que a lir a la otorapagina de php solo me aparezcan los elementos seleccionados.
el error esta en que me selecciona todos.
Se que existe una forma ocodigos que hacen eso , pero no los recuerdo y por eso necesito su ayuda urgentemente.

mi codigo de la lista de elementos es :
Código PHP:
<?
session_start
();
include(
"include/db.php");
include(
"include/functions.php");
db_connect();

if(!isset(
$_SESSION['user'])) {
    
header("Location: index.php");
}
?>
<html>
<head>
    <title>CESAD</title>
<link rel="stylesheet" href="include/estilos.css" type="text/css">
<script language="JavaScript" type="text/javascript">
function Visible(val) {
    if(val == 'On') {
        document.getElementById('tblPassword').style.display = 'block';
        document.getElementById('tblMsgErr').style.display = 'none';
    }if(val == 'Off') {
        document.getElementById('tblPassword').style.display = 'none';
        document.getElementById('tblMsgErr').style.display = 'none';
    }
}
</script>
</head>

<body>

<?include("cabecera.php");?>

<form name="frmMiCuenta" method="post" action="<?echo $_SERVER['PHP_SELF']?>" onsubmit="return validaUser();">
<table border="0" width="774" height="458" cellpadding="0" cellspacing="0">
<tr>
    <td valign="top" align="center">
    
        <table border="0" width="650" cellpadding="0" cellspacing="0" align="center">
        <tr>
            <td align="center"><p class="clsLblTituloPagina">Oficinas de Enlace - ODEs</p></td>
        </tr>
        <tr>
            <td><hr></td>
        </tr>
        </table>
        <br>
        
        <table border="0" width="650" cellpadding="0" cellspacing="0" align="center">
        <tr>
            <td class="clsTituloTabla" align="center" width="30">Nro.</td>
            <td class="clsTituloTabla">Ode</td>
            <td class="clsTituloTabla">Direccion</td>
            <td class="clsTituloTabla">Telefono</td>
            <td class="clsTituloTabla">&nbsp;</td>
        </tr>
        </table>
        
        <div style="height:350;width:650;overflow:auto">
        <table border="0" width="630" cellpadding="0" cellspacing="0" align="center">
        <?
        $sql_odes 
"SELECT id_ode, nombre, direccion, telefono FROM ode 
                    ORDER BY nombre"
;
        
$ode_query db_query($sql_odes);
        
$i 1;
        while(
$ode db_fetch_array($ode_query)) {
        
?>
        <tr onmouseover="this.className='dataTableRowSelected'" onmouseout="this.className='dataTableRow'">
            <td height="22" align="center" width="30"><?echo $i?></td>
            <td><?echo $ode['nombre']?></td>
            <td><?echo $ode['direccion']?></td>
            <td><?echo $ode['telefono']?></td>
            <?if($_SESSION['tipo_user'] == '0' or $_SESSION['tipo_user'] == '1') {?>
                <td align="center"><a href="ode_editar.php?IDode=<?echo $ode['id_ode']?>"><img border="0" src="images/edit.gif"> Editar</a></td>
                               <td align="center"><a href="odes_seleccionadas.php?IDode=<?echo $ode['id_ode']?>"><img border="0" src="images/Check.jpg"> Seleccionar</a></td>
            <?}?>
            
        </tr>
        <tr>
            <td colspan="5" height="1" bgcolor="#000000"></td>
        </tr>
        <?
        $i
++;
        }
        
?>
        </table>
        </div>
        
    </td>
</tr>
</table>
</form>

<?include("pie.php");?>

</body>
</html>

y la pagina donde deseo que aparezcan solo los seleccionados es similar pero solo con un ligero cambio:
Código PHP:
<?
session_start
();
include(
"include/db.php");
include(
"include/functions.php");
db_connect();

if(!isset(
$_SESSION['user'])) {
    
header("Location: index.php");
}
?>
<html>
<head>
    <title>CESAD</title>
<link rel="stylesheet" href="include/estilos.css" type="text/css">
<script language="JavaScript" type="text/javascript">
function Visible(val) {
    if(val == 'On') {
        document.getElementById('tblPassword').style.display = 'block';
        document.getElementById('tblMsgErr').style.display = 'none';
    }if(val == 'Off') {
        document.getElementById('tblPassword').style.display = 'none';
        document.getElementById('tblMsgErr').style.display = 'none';
    }
}
</script>
</head>

<body>

<?include("cabecera.php");?>

<form name="frmMiCuenta" method="post" action="<?echo $_SERVER['PHP_SELF']?>" onsubmit="return validaUser();">
<table border="0" width="774" height="458" cellpadding="0" cellspacing="0">
<tr>
    <td valign="top" align="center">
    
        <table border="0" width="650" cellpadding="0" cellspacing="0" align="center">
        <tr>
            <td align="center"><p class="clsLblTituloPagina">Oficinas de Enlace - OPEs</p></td>
        </tr>
        <tr>
            <td><hr></td>
        </tr>
        </table>
        <br>
        
        <table border="0" width="650" cellpadding="0" cellspacing="0" align="center">
        <tr>
            <td class="clsTituloTabla" align="center" width="30">Nro.</td>
            <td class="clsTituloTabla">Ode</td>
            <td class="clsTituloTabla">Direccion</td>
            <td class="clsTituloTabla">Telefono</td>
            <td class="clsTituloTabla">&nbsp;</td>
        </tr>
        </table>
        
        <div style="height:350;width:650;overflow:auto">
        <table border="0" width="630" cellpadding="0" cellspacing="0" align="center">
        <?
        $sql_odes 
"SELECT id_ode, nombre, direccion, telefono FROM ode 
                    ORDER BY nombre"
;
        
$ode_query db_query($sql_odes);
        
$i 1;
        while(
$ode db_fetch_array($ode_query)) {
        
?>
        <tr onmouseover="this.className='dataTableRowSelected'" onmouseout="this.className='dataTableRow'">
            <td height="22" align="center" width="30"><?echo $i?></td>
            <td><?echo $ode['nombre']?></td>
            <td><?echo $ode['direccion']?></td>
            <td><?echo $ode['telefono']?></td>
            <?if($_SESSION['tipo_user'] == '0' or $_SESSION['tipo_user'] == '1') {?>
                <td align="center"><img border="0" src="images/borrar.jpg"> Borrar</a></td>
                            





            <?}?>
            
        </tr>
        <tr>
            <td colspan="5" height="1" bgcolor="#000000"></td>
        </tr>
        <?
        $i
++;
        }
        
?>
        </table>
        </div>
        
    </td>
</tr>
</table>
</form>

<?include("pie.php");?>

</body>
</html>