03-25-2012, 19:13
Hello,
So I made this form that edits a .txt when you enter the the text then sumbit it. What i need help with is how would I get it to enter an extra comma at the beginning without entering it into the textbox?
I already tried
But no luck. Any way I can do this?
Heres the code:
Any help is appreciated
Thanks,
ScHmIdTy
So I made this form that edits a .txt when you enter the the text then sumbit it. What i need help with is how would I get it to enter an extra comma at the beginning without entering it into the textbox?
I already tried
PHP Code:
$add = $_POST['addition'] + ", ";
But no luck. Any way I can do this?
Heres the code:
PHP Code:
<?php
$fn = "test.txt";
$file = fopen($fn, "a+");
$size = filesize($fn);
if($_POST['addition']) fwrite($file,$_POST['addition']);
$text = fread($file, $size);
fclose($file);
?>
<form action="<?=$PHP_SELF?>" method="post">
<textarea><?=$text?></textarea><br/>
<input type="text" name="addition"/>
<input type="submit"/>
</form>
Any help is appreciated
Thanks,
ScHmIdTy