Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/11/2007, 18:57
Avatar de Marvin
Marvin
Colaborador
 
Fecha de Ingreso: febrero-2005
Ubicación: global $Chile->Santiago;
Mensajes: 1.991
Antigüedad: 19 años, 3 meses
Puntos: 81
Re: Requecoger Variable y concatenarla

Código PHP:
<?


// Primero pregunto si se ha llegado la variable por Method GET
if(strlen(trim($_GET["strNomImg"])) == 0){
    
// No ha llegado, por tanto: 
    
$strError="Ha ocurrido un error.";
}else{
    
// Si entra aquí implica que la variable ha llegado con contenido
    // Limpio variable de Informacion de Errores
    
$strError="";

    
// Y recojo el contenido de la varible GET 
    
$strNomImg=$_GET["strNomImg"];
}
?>

<html>
<head>
<title>Detalles Fotos</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?//Abro PHP
//Si la variable esta llena muestro Mensaje Error
If (strlen(trim($strErr))>0){ 
?>
<tr> 
<td align="center" valign="middle">
<?=$strErr?> //Asi :D
</td> 
</tr> 
<?
}else{ 
/* En caso que no exista Error se Muestra la img concatenando
el contenido de la variable strImgNom con el ".jpg". Ahora si :D */ 
?>
<tr>
<td align="center" valign="middle"><img src="imgs/<?=$strNomImg?>.jpg" border="0"></td>
</tr>
<?}?>
</table>
</body>
<html>
Prueba y nos cuentas!
Suerte!
__________________
El que dice "Solo sé que nada sé", esta asumiendo que sabe algo.
Lea las FAQ's!