Formulario:
Código:
crear.php:<form method="get" action="crear.php"> <input type="text" name="nombre" /> <input type="button" value="crear" /> </form>
Código:
string.php:<?php
$nombre = $_GET['nombre'];
$archivo = "archivos/" . $nombre . ".txt";
$fp = fopen($archivo, "a");
$string = "0";
$write = fputs($fp, $string);
fclose($fp);
$php = "archivos/" . $nombre . ".php";
$fp = fopen($php, "a");
$string = include('string.php');
$write = fputs($fp, $string);
fclose($fp);
?>
Código:
La duda es, porqué en el archivo.php creado no se incluye el contenido de $string? <?php
$fp = fopen("archivos/".$nombre.".txt","r");
$visitas = intval(fgets($fp));
$visitas++;
fclose($fp);
$fp = fopen("archivos/".$nombre.".txt","w");
fputs($fp,$visitas);
echo $visitas;
?>


