Ответы пользователя по тегу Веб-разработка
  • PHP создаёт php как это сделать?

    слеш добавь перед спец символами

    $nD = "index";
    $nS = "example";
    $html = "
    <?php
    \$y = rand(1, 9) ; 
    ?>
    <html>
    <head>
    <title>Master</title>
    <script>
    setTimeout( 'location= \"http://site.ru/maps/$nD.php?id=<? echo \$y;?>\";', 100 );
    </script>
    
    </head>
    <body>
    </body>
    </html>";
    
    $var = "$html";
      $f = fopen("maps/$nS.php","w+");
      fwrite($f,$var); 
      fclose($f);


    результат:

    <?php
    $y = rand(1, 9) ; 
    ?>
    <html>
    <head>
    <title>Master</title>
    <script>
    setTimeout( 'location= "http://site.ru/maps/index.php?id=<? echo $y;?>";', 100 );
    </script>
    
    </head>
    <body>
    </body>
    </html>
    Ответ написан
    Комментировать