Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/08/2009, 15:51
AdriHeredia
 
Fecha de Ingreso: mayo-2006
Mensajes: 11
Antigüedad: 18 años, 6 meses
Puntos: 0
Ayuda php por favor

basicamente lo que necesito es que
if($clientes == "%LA CANTIDAD QUE SEA%")
se genere lo siguiente
{
$cam%NUMERO%= '.$cam%NUMERO% .';
echo '
<a onclick="javascript:popUp(\'m.php?c='.$cam%NUMERO% .'\')" href=#?c='.$cam%NUMERO%.'">'.$cam%NUMERO%.'</a></br>
'; }
#<--##---(((((if $cliente == "0")))) ---##--->#
else{' no camaras instaladas'; }

GRACIAS DESDE YA A TODOS LOS QUE SE INTERESEN EN AYUDARME!!



con que funcion evito esta chorrera de codigo en vano que estoy utilizando?

Código:
<?
if($clientes == "1")
{ 
$caa= ''.$cam1.'';
echo '
<a onclick="javascript:popUp(\'monitorv5.php?c='.$caa.'\')" href=#?c='.$caa.'">'.$cam1.'</a></br> 
'; }
if($clientes == "2"){ 
$caa= ''.$cam1.'';
$cab= ''.$cam2.'';
echo '
<a onclick="javascript:popUp(\'monitorv5.php?c='.$caa.'\')" href=#?c='.$caa.'">'.$cam1.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cab.'\')" href=#?c='.$cab.'">'.$cam2.'</a></br> 
'; }
if($clientes == "3"){ 
$caa= ''.$cam1.'';
$cab= ''.$cam2.'';
$cac= ''.$cam3.'';

echo '
<a onclick="javascript:popUp(\'monitorv5.php?c='.$caa.'\')" href=#?c='.$caa.'">'.$cam1.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cab.'\')" href=#?c='.$cab.'">'.$cam2.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cac.'\')" href=#?c='.$cac.'">'.$cam3.'</a></br> 
';
}
else if($clientes == "4")
{ 
$caa= ''.$cam1.'';
$cab= ''.$cam2.'';
$cac= ''.$cam3.'';
$cad= ''.$cam4.'';
echo '
<a onclick="javascript:popUp(\'monitorv5.php?c='.$caa.'\')" href=#?c='.$caa.'">'.$cam1.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cab.'\')" href=#?c='.$cab.'">'.$cam2.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cac.'\')" href=#?c='.$cac.'">'.$cam3.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cad.'\')" href=#?c='.$cad.'">'.$cam4.'</a></br> 
';
}
if($clientes == "5")
{ 
$caa= ''.$cam1.'';
$cab= ''.$cam2.'';
$cac= ''.$cam3.'';
$cad= ''.$cam4.'';
$cae= ''.$cam5.'';
echo '
<a onclick="javascript:popUp(\'monitorv5.php?c='.$caa.'\')" href=#?c='.$caa.'">'.$cam1.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cab.'\')" href=#?c='.$cab.'">'.$cam2.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cac.'\')" href=#?c='.$cac.'">'.$cam3.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cad.'\')" href=#?c='.$cad.'">'.$cam4.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cae.'\')" href=#?c='.$cae.'">'.$cam5.''.$x.'</a></br> 
'; }
if($clientes == "6")
{ 
$caa= ''.$cam1.'';
$cab= ''.$cam2.'';
$cac= ''.$cam3.'';
$cad= ''.$cam4.'';
$cae= ''.$cam5.'';
$caf= ''.$cam6.'';
echo '
<a onclick="javascript:popUp(\'monitorv5.php?c='.$caa.'\')" href=#?c='.$caa.'">'.$cam1.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cab.'\')" href=#?c='.$cab.'">'.$cam2.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cac.'\')" href=#?c='.$cac.'">'.$cam3.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cad.'\')" href=#?c='.$cad.'">'.$cam4.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cae.'\')" href=#?c='.$cae.'">'.$cam5.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$caf.'\')" href=#?c='.$caf.'">'.$cam6.'</a></br> 
'; }
if($clientes == "7")
{ 
$caa= ''.$cam1.'';
$cab= ''.$cam2.'';
$cac= ''.$cam3.'';
$cad= ''.$cam4.'';
$cae= ''.$cam5.'';
$caf= ''.$cam6.'';
$cag= ''.$cam7.'';
echo '
<a onclick="javascript:popUp(\'monitorv5.php?c='.$caa.'\')" href=#?c='.$caa.'">'.$cam1.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cab.'\')" href=#?c='.$cab.'">'.$cam2.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cac.'\')" href=#?c='.$cac.'">'.$cam3.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cad.'\')" href=#?c='.$cad.'">'.$cam4.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cae.'\')" href=#?c='.$cae.'">'.$cam5.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$caf.'\')" href=#?c='.$caf.'">'.$cam6.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cag.'\')" href=#?c='.$cag.'">'.$cam7.'</a></br> 
'; }
if($clientes > "8")
{ 
$caa= ''.$cam1.'';
$cab= ''.$cam2.'';
$cac= ''.$cam3.'';
$cad= ''.$cam4.'';
$cae= ''.$cam5.'';
$caf= ''.$cam6.'';
$cag= ''.$cam7.'';
$cah= ''.$cam8.'';
echo '
<a onclick="javascript:popUp(\'monitorv5.php?c='.$caa.'\')" href=#?c='.$caa.'">'.$cam1.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cab.'\')" href=#?c='.$cab.'">'.$cam2.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cac.'\')" href=#?c='.$cac.'">'.$cam3.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cad.'\')" href=#?c='.$cad.'">'.$cam4.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cae.'\')" href=#?c='.$cae.'">'.$cam5.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$caf.'\')" href=#?c='.$caf.'">'.$cam6.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cag.'\')" href=#?c='.$cag.'">'.$cam7.'</a></br> 
<a onclick="javascript:popUp(\'monitorv5.php?c='.$cah.'\')" href=#?c='.$cah.'">'.$cam8.'</a></br> 
'; }
else{'no camaras instaladas'; }
?>