Ik zit met een raar probleem, als ik het volgende post zet hij na elke lijn een extra newline. Hoe zou ik dit kunnen oplossen of wat doe ik fout ?
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
| <? if($_POST['post'] == 1 && is_writable("files/index.php")) { $handle = fopen ("files/index.php", 'wt'); $text = $_POST['test']; $text = str_replace('/"', '"', $text); $text = nl2br($text); $text = str_replace('<br />', '', $text); fwrite($handle,$text); echo "Geshreven"; fclose($handle); } ?> <form method="post" action="index.php"> <textarea name="test" rows=30 cols=100 ><?php $handle2 = fopen ("files/index.php", 'r'); while (!feof ($handle2)) { $buffer = fgets($handle2, 4096); echo $buffer; } fclose ($handle2); ?></textarea> <input type="hidden" name="post" value="1"> <input type="submit" name="Submit" value="Send Form"> </form> |