Facebook Twitter Reset

This Tutorial Has Been Viewed 1,169 Times.

Appending string using php to a text file

 

A very easy way to append string to a file using simple php script 

<?php

$fn = “file.txt”;

$file = fopen($fn, “a+”);

$space.= “\n”;

if($_POST['addition']) fwrite($file, $_POST['addition']);

fwrite ($file, $space);

fclose($file);

?>

<form action=”<?=$PHP_SELF?>” method=”post”>

<input type=”text” name=”addition”/><br/>

<input type=”submit”/>

</form>

 


VN:F [1.9.13_1145]
Rating: 5.5/10 (2 votes cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)
Appending string using php to a text file, 5.5 out of 10 based on 2 ratings


You will also be interested in ,

One Response to “Appending string using php to a text file”

  1. April 25, 2009 at 11:01 am #

    Testing the form.

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)

Leave a Comment

Spam protection by WP Captcha-Free

Affordable Seo PackagesSeo BlogEdu Backlinks
More in JavaScripts (36 of 80 articles)