0

Failed to write correctly in existing text file.. Is there a way to display correctly the post values? Thanks in advance.

$mar1 = $_POST['id'] . PHP_EOL;
$mar2 .= $_POST['titel'] . PHP_EOL;
$existing = file_get_contents('stan.txt');
$fp = fopen('stan.txt', 'w');    
$myString = '<h6><a href="$mar1-$mar2.php">$mar1 $mar2</a></h6>'. PHP_EOL; 
fwrite($fp, $existing. $myString);
fclose($fp);

0 Answers0