Просмотр поста

.
localhost
OnLine Quest Game

Короче теперь сути такова блин.
Все норма, файл создается, но название получается кракозябрами, вводил английскими.
Потом, там где титл должен быть получается вот что, собственно сам код который оказался в файле

<?php define('_IN_JOHNCMS', 1);
Без имени = 'testes' ;
require_once ("../incfiles/core.php");
require_once ("../incfiles/head.php");

require_once ("../incfiles/end.php"); ?>


А вот код который создает сам файл.
<?php
define('_IN_JOHNCMS', 1);
require_once ("../incfiles/core.php");
require_once ("../incfiles/head.php");
switch ($act) {
    case 'go':
        $name = $_POST['name'];
        $code = $_POST['code'];
        $title = $_POST['title'];

        $ololo1 = "<?php define('_IN_JOHNCMS', 1);" . "\n" . "$textl = '$title' ;" . "\n" .
            "require_once (\"../incfiles/core.php\");" . "\n" . "require_once (\"../incfiles/head.php\");" .
            "\n";

        $ololo2 = "\n" . "require_once (\"../incfiles/end.php\"); ?>";


        $fh = fopen($name . '.php', "w") or die("не могу создать файл");
        fwrite($fh, $ololo1);
        fwrite($fh, $code);
        fwrite($fh, $ololo2);

        fclose($fh);
        break;
    default:
}
echo '<form action="index.php?act=go" method="post"><div class="gmenu">';
echo '<b>Титл</b><br/><input type="text" name="name" /><br />';
echo '<b>Код</b><br/><input type="text" name="code" /><br/>';
echo '<div class="menu">Имя<br/><input type="text" name="title" /></div>';
echo '<div class="bmenu"><input type="submit" name="submit" value="Проба"/></div></div></form>';
require_once ("../incfiles/end.php");
?>