Phil: Text GENAU so wie angegeben in eine andere datei schreiben

Beitrag lesen

Hallo Leute !
Ich will folgendes erreichen!

ich habe die
datei control.php
--------------------------
<html>
<head>
<title>Control</title>
</head>
<body>
<form action="formarbeit.php" method="post">
 <input type="text" name="newestArtist">
 <input type="submit" name="Submit">
</form>
</body>
</html>
--------------------------
die datei formarbeit.php
--------------------------
1 <?
2 if (file_exists("cms.php")) {
3 fclose(fopen( 'cms.php', 'w+'));
4 $fp = fopen( "cms.php", 'w' );
5 $lol = $_POST['newestArtist'];
6 fwrite($fp, "<?\n$newA = "$lol"; \n?>");
7 fclose($fp);
8 }
9 ?>
-------------------------------------
und die datei cms.php in der nix steht!

In control.php wird per Formular der Wert "Text" abgeschickt!
In Zeile 6 soll er genau das folgende in die Datei cms.php schreiben!
<?
$newA = "Text";
?>

---- > das klappt auch FAST komplett nur das Wort $newA schreibt er nicht rein!
Warum nicht? und wie kann ich das machen!?

thx

mfg

Phil