Ver Mensaje Individual
  #2 (permalink)  
Antiguo 04/03/2009, 03:02
gomminola
 
Fecha de Ingreso: mayo-2008
Mensajes: 253
Antigüedad: 16 años, 9 meses
Puntos: 8
Respuesta: integrar 2 archivos php en 1

Este es el segundo archivo

2- Insertar.php

Código PHP:
<html><head><script>function disableselect(e)
{  return false  }
function reEnable()
{  return true  }
//Si es Internet Explorer 4 o superior
document.onselectstart=new Function ("return false")
//si es Netscape6
if (window.sidebar)
{  document.onmousedown=disableselect
   document.onclick=reEnable  }</script><style>body         { font-family: tahoma; font-size: 8 pt }
.vol         { color: #0000FF }
.vol:hover   { text-decoration: underline; color: #800000 }
.mas         { color: #000000 }
.mas:hover   { text-decoration: none; color: #888888 }
a            { color: #FF0000; text-decoration: none }
a:hover      { color: #000080; text-decoration: underline }
table         { font-size: 8pt }
.boton       { background-color: #00B4FF; color: #FFFFFF; font-family: 
               verdana, arial, helvetica; font-size: 8.5pt; 
               border-left: 2px Solid #00D6FF; border-right: 2px Solid #0092DD; 
               border-top: 2px Solid #00D6FF; border-bottom: 2px Solid #0092DD }
.art         { clear: none; float: none; height: 100%; width: 100%; color: #FFFFFF; 
               text-decoration: none }
.art:hover   { background-color: #0099FF; clear: none; float: none; height: 100%; align: 
               center; width: 100%; color: #000080; text-decoration: none }
.nombre { color: #000088; text-decoration: none }
.nombre:hover { text-decoration: underline }
</style><title>Ommadawn , tu oportunidad de conocer a fondo a Mike Oldfield</title></head>
<body topmargin="0" leftmargin="0"><center>
  <table border="0" cellpadding="0" cellspacing="0" width="759">
    <tr>
      
    </tr>
  </table>
  </center>
  <center>
  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>

    </tr>
  </table>
  </center>
  <center>
  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td width="75%" valign="top" bgcolor="#FFE6FF">
        <center>
          <table border="0" cellpadding="0" cellspacing="0" width="90%" height="43">
            <tr>
              <td width="100%" height="43"><fieldset><legend></legend>
                <label>
        <center>
          <center><table cellpadding="0" cellspacing="0" width="60%" border="0"><tr><td width="100%">
                        </center></center>
        </center>
                  </center>
        <p align=justify>
        <?php

$fp
=fopen("index.txt","r+"); 
$anterior=fread($fp,filesize("index.txt"));
rewind($fp);
$nuevo "<b><font color=\"#000088\" size=\"2\"><a href=\"mailto:$HTTP_GET_VARS[email]\" class=\"nombre\">$HTTP_GET_VARS[nombre]</a> <font color=\"#0056F9\">($HTTP_GET_VARS[fecha])</font></font></b>&nbsp;&nbsp;<img src=\"$HTTP_GET_VARS[opinion].gif\" border=0><br><p align=justify>$HTTP_GET_VARS[comentario]<hr>";
$total $nuevo.$anterior;
if(
fwrite($fp,$total)) {
Echo 
"Gracias, tu comentario ha sido insertado correctamente. <p align=center><a href=index.php>Volver</a>";
}Else{
Echo 
"Error, por alguna razón desconocida no ha sido procesado su comentario. Compruebe que ha rellenado todos los campos e inténtelo de nuevo.";
}
fclose($fp);
?> 


<?php

$fp 
fopen("ultimo.txt","w"); 
if(
fwrite($fp"Último comentario en el libro de visitas:<p align=justify>$HTTP_GET_VARS[comentario]<br><br><b>Enviado por <a href=\"mailto:$HTTP_GET_VARS[email]\">$HTTP_GET_VARS[nombre]</a></b><p align=right><b><a href=\"libro/index.php\" class=vol>Ver más</a></b>")){
Echo 
" ";
}Else{
Echo 
" ";
}
fclose($fp);
?></p>
 </td></tr></table></label></fieldset> </td>
            </tr>
          </table>      </td>
    </tr>
  </table>
  </body></html>
Bien todo esto funciona de maravilla subiendolo al servidor, pero ahora viene mi gran problema, dilema y agobio ¿puedo unir estos 2 archivos en 1?, estoy intentandolo desde hace días y no lo consigo con mas manuales de php que me leo, necesito que este todo en 1 . Muchas gracias maestros y espero me puedan ayudar.