Priya
Priya

Reputation: 1554

how can i make an interface in php to add data csv file

hey...i need to create a html+php+javascript interface

where i got three text area and i want::::

that if i'll enter some data into text area and pressing submit button,,then it'll enter that textarea's data into a csv file..

pls some one help....

Upvotes: 1

Views: 388

Answers (2)

rajmohan
rajmohan

Reputation: 1618

$fp = fopen('file.csv', 'w'); fputcsv($fp, $_GET['TextArea']); fclose($fp);

?>

Upvotes: 0

tHeSiD
tHeSiD

Reputation: 5363

<?php

$list = arrary(); 
//your array will have all the fields from the form, textfields and textareas

$fp = fopen('output.csv', 'w');

foreach ($list as $fields) {
    fputcsv($fp, $fields);
}

fclose($fp);
?>

Upvotes: 1

Related Questions