Foros del Web » Programando para Internet » PHP »

Crear TABLA 5 filas, 4 columnas con contenido dentro de texto + foto

Estas en el tema de Crear TABLA 5 filas, 4 columnas con contenido dentro de texto + foto en el foro de PHP en Foros del Web. hola, estoy en la última fase de mi script PHP i ahora lo que quiero esque a partir de mi formulario donde obtengo 3 variables ...
  #1 (permalink)  
Antiguo 28/07/2007, 08:51
 
Fecha de Ingreso: junio-2007
Ubicación: En mi casa
Mensajes: 82
Antigüedad: 16 años, 10 meses
Puntos: 2
Crear TABLA 5 filas, 4 columnas con contenido dentro de texto + foto

hola, estoy en la última fase de mi script PHP i ahora lo que quiero esque a partir de mi formulario donde obtengo 3 variables que son NOMBRE, LINK i UBICACION de la IMAGEN, pues que me vaya creando una TABLA en un archivo de página, i le estoy dando vueltas pero no se como habría que hacerlo exactamente, si alguien pudiese darme alguna pista o algo de información le agradecería. Aqui tengo mi código.

Código HTML de la tabla completa

Código:
<table cellSpacing="0" cellPadding="0" width="80%" align="center" border="0">
  <tr>
    <td width="31" height="43"><big><img height="43" src="tlc.jpg" width="31"></big></td>
    <td background="tbg.jpg"></td>
    <td width="31" height="43"><big><img height="43" src="trc.jpg" width="31"></big></td>
  </tr>
  <tr>
    <td vAlign="bottom" align="right" background="lbg.jpg"></td>
    <td align="center" bgcolor="#FFFFFF"><table border="0" cellpadding="5" cellspacing="0"
    width="100%">
      <tr>
        <td width="100%" valign="top" align="center" colspan="4"></td>
      </tr>
      <tr>
        <td width="25%" valign="top" align="center"><small><strong><a
        href="LINK" target="_blank">NOMBRE</a></strong></small><br>
        <img src="IMAGEN" width="170" height="120"></td>
        <td width="25%" valign="top" align="center"><small><strong><a
        href="" target="_blank"></a></strong></small><br>
        <img src="" width="170" height="120"></td>
        <td width="25%" valign="top" align="center"><small><strong><a
        href="" target="_blank"></a></strong></small><br>
        <img src=".jpg" width="170" height="120"></td>
        <td width="25%" valign="top" align="center"><small><strong><a
        href="" target="_blank"></a></strong></small><br>
        <img src="" width="170" height="120"></td>
      </tr>
      <tr>
        <td width="25%" valign="top" align="center"><small><strong><a
        href="" target="_blank"></a></strong></small><br>
        <img src="" width="170" height="120"></td>
        <td width="25%" valign="top" align="center"><small><strong><a
        href="" target="_blank"></a></strong></small><br>
        <img src="" width="170" height="120"></td>
        <td width="25%" valign="top" align="center"><small><strong><a
        href="" target="_blank"></a></strong></small><br>
        <img src=".jpg" width="170" height="120"></td>
        <td width="25%" valign="top" align="center"><small><strong><a
        href="" target="_blank">
        </a></strong></small><br>
        <img src="" width="170" height="120"></td>
      </tr>
      <tr>
        <td width="25%" valign="top" align="center"><small><strong><a
        href="" target="_blank"></a></strong></small><br>
        <img src="" width="170" height="120"></td>
        <td width="25%" valign="top" align="center"><small><strong><a
        href="" target="_blank"></a></strong></small><br>
        <img src="" width="170" height="120"></td>
        <td width="25%" valign="top" align="center"><small><strong><a
        href="" target="_blank"></a></strong></small><br>
        <img src=".jpg" width="170" height="120"></td>
        <td width="25%" valign="top" align="center"><small><strong><a
        href="" target="_blank">
        </a></strong></small><br>
        <img src="" width="170" height="120"></td>
      </tr>
      <tr>
        <td width="25%" valign="top" align="center"><small><strong><a
        href="" target="_blank"></a></strong></small><br>
        <img src="" width="170" height="120"></td>
        <td width="25%" valign="top" align="center"><small><strong><a
        href="" target="_blank"></a></strong></small><br>
        <img src="" width="170" height="120"></td>
        <td width="25%" valign="top" align="center"><small><strong><a
        href="" target="_blank"></a></strong></small><br>
        <img src=".jpg" width="170" height="120"></td>
        <td width="25%" valign="top" align="center"><small><strong><a
        href="" target="_blank">
        </a></strong></small><br>
        <img src="" width="170" height="120"></td>
      </tr>
      <tr>
        <td width="25%" valign="top" align="center"><small><strong><a
        href="" target="_blank"></a></strong></small><br>
        <img src="" width="170" height="120"></td>
        <td width="25%" valign="top" align="center"><small><strong><a
        href="" target="_blank"></a></strong></small><br>
        <img src="" width="170" height="120"></td>
        <td width="25%" valign="top" align="center"><small><strong><a
        href="" target="_blank"></a></strong></small><br>
        <img src=".jpg" width="170" height="120"></td>
        <td width="25%" valign="top" align="center"><small><strong><a
        href="" target="_blank">
        </a></strong></small><br>
        <img src="" width="170" height="120"></td>
      </tr>
      <tr>
        <td width="25%" valign="top" align="center"></td>
        <td width="25%" valign="top" align="center"></td>
        <td width="25%" valign="top" align="center"></td>
        <td width="25%" valign="top" align="center"><strong><small><a href="index_adventure.php">1</a></small></strong></td>
      </tr>
    </table>
    </td>
    <td vAlign="top" background="rbg.jpg"></td>
  </tr>
  <tr>
    <td width="31" height="29"><big><img height="29" src="blc.jpg" width="31"></big></td>
    <td background="bbg.jpg"></td>
    <td width="31" height="29"><big><img height="29" src="brc.jpg" width="31"></big></td>
  </tr>
</table>
Códio HTML de la tabla inicial

Código:
<table cellSpacing="0" cellPadding="0" width="80%" align="center" border="0">
  <tr>
    <td width="31" height="43"><big><img height="43" src="tlc.jpg" width="31"></big></td>
    <td background="tbg.jpg"></td>
    <td width="31" height="43"><big><img height="43" src="trc.jpg" width="31"></big></td>
  </tr>
  <tr>
    <td vAlign="bottom" align="right" background="lbg.jpg"></td>
    <td align="center" bgcolor="#FFFFFF"><table border="0" cellpadding="5" cellspacing="0"
    width="100%">
      <tr>
        <td width="100%" valign="top" align="center" colspan="4"></td>
      </tr>
      <tr>
        
<!-- TABLA -->
	
	<td width="25%" valign="top" align="center"><small><strong><a
        href="$LINK" target="_blank">$NOMBRE</a></strong></small><br>
        <img src="$IMAGEN" width="170" height="120"></td>

      </tr>

      <tr>
        <td width="25%" valign="top" align="center"></td>
        <td width="25%" valign="top" align="center"></td>
        <td width="25%" valign="top" align="center"></td>
        <td width="25%" valign="top" align="center"><strong><small><a href="index_adventure.php">1</a></small></strong></td>
      </tr>
    </table>
    </td>
    <td vAlign="top" background="rbg.jpg"></td>
  </tr>
  <tr>
    <td width="31" height="29"><big><img height="29" src="blc.jpg" width="31"></big></td>
    <td background="bbg.jpg"></td>
    <td width="31" height="29"><big><img height="29" src="brc.jpg" width="31"></big></td>
  </tr>
</table>
No se como hacerlo, hice 1 script que busca una determinada cadena i reemplaza su contenido en 1 archivo pero aqui no sabria como utilizarlo, supongo que habría que utilizar una especie de variable que se incrementara, i que cada 4 veces se pusiera una nueva fila i en este momento, otra que se incrementara hasta 5, pero no se como aplicarlo. Buscaría en PHP la cadena "<-- TABLA -->" para empezar el código. Gracias
  #2 (permalink)  
Antiguo 28/07/2007, 10:53
 
Fecha de Ingreso: junio-2007
Ubicación: En mi casa
Mensajes: 82
Antigüedad: 16 años, 10 meses
Puntos: 2
Re: Crear TABLA 5 filas, 4 columnas con contenido dentro de texto + foto

estoy intentando hacerlo, pero tengo problemas para incrementar 1 variable que tengo en la posicion 0, no se me incrementa :( seria para que cuando llegara a 4 la variable esa, me creara una nueva fila, aqui pongo el que tengo hasta ahora hecho.

Código:
$taula_contador=file("index_adventure.php");
$taula_contador_=trim($taula_contador[0]);
$buscar="<!-- TABLE $taula_contador_ -->"; 
$taula_contador_=$taula_contador_+1;
$reemplazar="<!-- TABLE $taula_contador_ -->
	<td width=\"25%\" valign=\"top\" align=\"center\"><small><strong><a
        href=\"$php_name\" target=\"_blank\">$game</a></strong></small><br>
        <img src=\"$imagefile_name\" width=\"170\" height=\"120\"></td>"; 
$contenido=file("index_adventure.php");//leemos el archivo 
for($n=0;$n<count($contenido);$n++) 
{ 
$contenido[$n]=trim($contenido[$n]);//quitamos los espacios vacios al inicio y al final de cada línea 
if($contenido[$n]==$buscar)//si la linea actual es la que buscamos 
{ 
$contenido[$n]=$reemplazar;//la reemplazamos 
} 
} 
$escribir=implode("\n",$contenido);//nos simplificamos la vida usando nadamas el LF 
$fp=fopen("index_adventure.php","w");//abrimos el archivo para escribir 
fwrite($fp,$escribir,strlen($escribir));//escribimos el archivo 
fclose($fp);//cerramos el archivo
La posición zero de mi arhivo siempre se queda en "0", no se incrementa :(
gracias
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 02:12.