Ver Mensaje Individual
  #26 (permalink)  
Antiguo 02/06/2009, 15:32
Avatar de boy-computer
boy-computer
 
Fecha de Ingreso: diciembre-2006
Ubicación: Cuba, Pinar del Río
Mensajes: 337
Antigüedad: 17 años, 5 meses
Puntos: 1
Respuesta: Trabajando con ficheros

Mira este es el código del primer archivo:

pagina1.php
Código HTML:
<html>
<head>
<title>Pagina1</title>
</head>
<body>
<form action="ejecuta.php" method="post">
pagina1<br>
<textarea name="comentario" rows="12" cols="80" wrap="off">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Problema&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;/body&gt;
&lt;/html&gt;
</textarea><br>
<input type="submit" name="enviar" value="Enviar"><br>
<?php require_once('pagina2.php'); ?>
</form>
</body>
</html> 
Código del segundo archivo:

pagina2.php
Código HTML:
<html>
<head>
<title>Pagina2</title>
</head>

<body>
<form action="ejecuta.php" method="post">
pagina2.php <br>
<textarea name="programa2" rows="12" cols="80" wrap="off">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Problema&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;?php

?&gt;

&lt;/body&gt;
&lt;/html&gt;
</textarea>
</textarea>
</form>
</body>
</html> 
y este es el archivo que procesa al archivo 1:

Código PHP:
<?php
extract
($_GETEXTR_SKIP);
extract($_POSTEXTR_SKIP);

$datos=tempnam("C:/wamp/www/web/crear_fichero/""");
$ar=fopen($datos,"a") or die("Problemas en la creacion");
  
fwrite($ar,stripslashes($comentario));
  
fclose($ar);
  eval(
"include(\"$datos\");");
  eval(
"unlink(\"$datos\");");
?>
¿Cómo hago para que procese el archivo2 incluido en el 2?