title: PHP - How to create a file dynamically?
body: <p>I want to create PHP files dynamically. Static HTML code works fine, but when I want to insert PHP code, which contains a "window.location" command, my script directly send me to that page, without fulling the "if(isset())"-condition.</p>
  
  <p>Somehow a simple echo doesn't work. How can I fix this?</p>
  
  <pre><code> public function suche()
   {
     echo "if(isset(\$_POST['searchit']))
     {
      \$suchbegriff = \$_POST['suchbegriff'];
  
      \$anfangsbuchstabe = substr(\$suchbegriff, 0, 1);
  
      &lt;script type='text/javascript' language='Javascript'&gt;window.location = '/".$anfangsbuchstabe."/".$suchbegriff.".php'&lt;/script&gt;
    }";
   }
  </code></pre>