Check box

anibal leiva anibal.andres en gmail.com
Vie Sep 21 18:44:09 CLT 2007


Señores necesito su ayuda he tratado varias formulas de enviar los id,
pero no lo consigo, solo logro enviar solo el ultimo munero q' escojo,
pero no envia por ejemplo todos o algunos, pero mas de 1 solo envia el
ultimo,

------------------------------------------
function listado($resultado)
{
	//include("header.php");

	
	echo '<table align="center">';
	
	while($registro = mysql_fetch_array($resultado))
	
	{
		echo "<tr>";
			echo "<td>";
			echo '<font style=font-size:11pt;';
			//echo '<font color="red";';
			//echo "<td>";
			$id = $registro['id'];
			//echo "</td>";
			//echo "&nbsp &nbsp";
			echo "<td>";
			echo '<font style=font-size:9pt;';
			echo "<td>";
			echo $movil = substr(($registro['movil']), 3, 11);
			echo "</td>";
			//echo "&nbsp &nbsp";
			echo "<td>";
			echo '<font style=font-size:9pt;';
			echo "<td>";
			echo $usuario = $registro['usuario'];
			echo "</td>";
			//echo "&nbsp &nbsp";
			echo "<td>";
			echo '<font style=font-size:9pt;';
			echo "<td>";
			echo $empresa = $registro['empresa'];
			echo "</td>";
			//echo "&nbsp &nbsp";
			echo "<td>";
			echo '<font style=font-size:9pt;';
			echo "<td>";
			echo $sucursal = $registro['sucursal'];
			echo "</td>";
			//echo "&nbsp &nbsp";
			echo "<td>";
			echo '<font style=font-size:9pt;';
			echo "<td>";
			echo $area = $registro['area'];
			echo "</td>";
			//echo "&nbsp &nbsp";
			echo "<td>";
			echo '<font style=font-size:9pt;';
			echo "<td>";
			echo $cargo = $registro['cargo'];
			echo "</td>";
			echo "<td>";
			echo $moviles = "<input type='checkbox' name='movil' value='$movil'>";	
			echo "</td>";
			
		echo "</tr>";
	
	}
	echo "</table>";
	//include("footer.php");	
}
------------------------------------------------

como lo hago para enviarle todos los q' escoja, y recivir todos los q' envio???


<?php


include("funciones.php");

error_reporting(0);


if ( isset($_POST['mensaje']) and !empty($_POST['mensaje']) )
{


include("connect.bbdd.php");

$fecha = date('Y-m-d');
date_default_timezone_set("America/Santiago");
$hora = date("H:i:s");  //strftime('%H:%M:%S', time());
$dispositivo = 'interface';
$evento = 'envio de mensaje';
echo $descripcion = $_POST['mensaje'];
$estado = 1;


	$sql = "insert into
eventorecibidos(fecha,hora,dispositivo,ip,evento,estado) values
('$fecha','$hora','$dispositivo','$pcs','$evento','$estado')";
	

include("error.bbdd.php");


	echo "<script>
		alert('El mensaje fue enviado Exitosamente!');
		history.go(-1);
		</script>";
}
else
{
	die('Debe escribir un mensaje...');
}



{

$sql = "select movil from telefonos where cargo='TI'";

$resultadopcs = mysql_query($sql, $db);

include("E:\wamp\www\entel\error.bbdd.php");

}


$users = User($db);


$passwords = Password($db);


	
$sql = "select idmsg, fecha, hora, dispositivo, evento, ip from
eventorecibidos where estado='1'";
$resultado3 = mysql_query($sql, $db);
$coma = ",";

while($registro3 = mysql_fetch_array($resultado3))

{
	$evento = $registro3['evento'];
	$fecha = $registro3['fecha'];
	$hora = $registro3['hora'];
	$dispositivo = $registro3['dispositivo'];
	$ip = $registro3['ip'];
	$idmsg = $registro3['idmsg'];
		

	$msg = $descripcion;
	$uniq = $idmsg;
	echo $user = $users;
	echo $password= $passwords;
	echo $resultadopcs;
		
	while($registro = mysql_fetch_array($resultadopcs))
{
	$pcs = $registro['movil'];
	

	//$url = "http://localhost/entel/notify1.php";
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL,$url);
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS,
"Movil=$pcs&User=$user&Password=$password&Msg=$msg&IdMsg=$uniq");
	curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
	curl_setopt($ch, CURLOPT_TIMEOUT, 5);
	curl_setopt($ch, CURLOPT_FAILONERROR, 1);
	$respuesta = curl_exec ($ch);
		
	}
		
	echo $resuesta;
	echo $user;
	echo $password;
	echo $resultadopcs;

	
	$sql = "update eventorecibidos set estado=0 where idmsg = '$idmsg'";		
	
include("E:\wamp\www\entel\error.bbdd.php");

	{
		

	$sql = "update eventorecibidos set respuesta = '$respuesta' where
idmsg = '$idmsg'";
	
include("E:\wamp\www\entel\error.bbdd.php");	

	}		

	{
		

	$sql = "update eventorecibidos set origen = 'INTERFACE' where idmsg =
'$idmsg'";
	
include("E:\wamp\www\entel\error.bbdd.php");	

	}	
	
}


include("E:\wamp\www\entel\close.bbdd.php");

?>


espero se entienda, ha un agradecimiento especial al Master Daniel y
Ricardo, gracias por la ayuda

Salu2
Anibal L.



Más información sobre la lista de distribución PHP