Forum Moderators: coopster
<?php
$wpusername = $_POST['wpusername'];
$symbol = $_POST['symbol'];
$type = $_POST['type'];
$alert = $_POST['alert'];
$trigger = $_POST['trigger'];
$price = $_POST['price'];
//now we open the file using the a flag, this will create the file if
//it does not exist, and puts the pointer(where it starts writing) at the
//end of the file
$filename = "pricealerts.csv\";
$handle = chmod('/dir/path','0777') fopen($filename, 'b');
//now we prepare our string to be added:
$string_to_add = "$wpusername,$symbol,$type,$alert,$trigger,$price,\n";
fwrite($handle, $string_to_add);
//now close the file
fclose($handle);
?>
[edited by: dreamcatcher at 5:51 am (utc) on Aug 7, 2010]
[edit reason] exemplified server path [/edit]
<?php
$wpusername = $_POST['wpusername'];
$symbol = $_POST['symbol'];
$type = $_POST['type'];
$alert = $_POST['alert'];
$trigger = $_POST['trigger'];
$price = $_POST['price'];
//now we open the file using the a flag, this will create the file if
//it does not exist, and puts the pointer(where it starts writing) at the
//end of the file
$filename = "pricealerts.csv";
$handle = chmod('/dir/path','0777') fopen($filename, 'b');
//now we prepare our string to be added:
$string_to_add = "$wpusername,$symbol,$type,$alert,$trigger,$price,\n";
fwrite($handle, $string_to_add);
//now close the file
fclose($handle);
?>
$handle = chmod('/dir/path','0777') fopen($filename, 'b');
$string_to_add = $wpusername." ".$symbol." ".$type." ".$alert." ".$trigger." ".$price."\n";