PHP - How create a file dynamically?
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. 
Somehow a simple echo doesn't work. Do you know how I can fix it? Thanks!

     public function suche()
     {
       echo "if(isset(\$_POST['searchit']))
	   {
	    \$suchbegriff = \$_POST['suchbegriff'];
	  
	    \$anfangsbuchstabe = substr(\$suchbegriff, 0, 1);
	  
	    <script type='text/javascript' language='Javascript'>window.location = '/".$anfangsbuchstabe."/".$suchbegriff.".php'</script>
	  }";
     }


PHP - How create a file dynamically?
===

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. 
Somehow a simple echo doesn't work. Do you know how I can fix it? Thanks!

     public function suche()
     {
       echo "if(isset(\$_POST['searchit']))
	   {
	    \$suchbegriff = \$_POST['suchbegriff'];
	  
	    \$anfangsbuchstabe = substr(\$suchbegriff, 0, 1);
	  
	    <script type='text/javascript' language='Javascript'>window.location = '/".$anfangsbuchstabe."/".$suchbegriff.".php'</script>
	  }";
     }

