I am new to PHP so please explain to me like you would to a child ^_^. I am trying to write a simple php script and keep getting this error:
Parse error: syntax error, unexpected T_STRING in /home/alertsfortraders/www.addictedtotrading.com/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 14
<?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);
?>