I'm obtaining a weird message when I try to add the capability to write to a csv file into the formmail script that I'm using. Everything is fine initially and the email comes through to me perfectly from the simple HTML form I've designed. However, when I add the path to the CSV directory into the appropriate section in the php script being called, I get the following when I run the script:
Parse error: parse error, unexpected ';' in /home/myaccount/public_html/suggest/Feedback.php on line 5439
The $CSVDIR section looks like this:
[code=php]$CSVDIR = "/home/myaccount/public_html/csvdir"; // directory for csv files; empty string to
// disallow csv files
$CSVSEP = ","; // comma separator between fields (columns)
$CSVINTSEP = ";"; // semicolon is the separator for fields (columns)
// with multiple values (checkboxes, etc.)
$CSVQUOTE = '"'; // all fields in the CSV are quoted with this character;
// default is double quote. You can change it to
// single quote or leave it empty for no quotes.
//$CSVQUOTE = "'"; // use this if you want single quotes
$CSVOPEN = ""; // set to "b" to force line terminations to be
// kept as $CSVLINE setting below, regardless of
// operating system. Keep as empty string and
// leave $CSVLINE unchanged, to get text file
// terminations for your server's operating system.
// (Line feed on UNIX, carriage-return line feed on Windows).
$CSVLINE = "\n"; // line termination for CSV files. The default is
// a single line feed, which may be modified for your
// server's operating system. If you want to change
// this value, you *must* set $CSVOPEN = "b".[/code]
The section giving the error looks like this with the "if" part being Line 5439:
[code=php]{
global $TARGET_URLS;
foreach ($TARGET_URLS as $s_prefix)
if (!empty($s_pref ix) &&
strtolower(subs tr($s_url,0,str len($s_prefix)) ) ==
strtolower($s_p refix))
return (true);
return (false);
}[/code]
I don't know what's wrong with this. More bizarrely, when I remove this CSV modification and revert to the original script, this error stays! I'm not a programmer so I'm a bit stuck here. I'm just trying to use the script as an "out-of-the-box" solution.
Any help greatly appreciated.
Dave
Parse error: parse error, unexpected ';' in /home/myaccount/public_html/suggest/Feedback.php on line 5439
The $CSVDIR section looks like this:
[code=php]$CSVDIR = "/home/myaccount/public_html/csvdir"; // directory for csv files; empty string to
// disallow csv files
$CSVSEP = ","; // comma separator between fields (columns)
$CSVINTSEP = ";"; // semicolon is the separator for fields (columns)
// with multiple values (checkboxes, etc.)
$CSVQUOTE = '"'; // all fields in the CSV are quoted with this character;
// default is double quote. You can change it to
// single quote or leave it empty for no quotes.
//$CSVQUOTE = "'"; // use this if you want single quotes
$CSVOPEN = ""; // set to "b" to force line terminations to be
// kept as $CSVLINE setting below, regardless of
// operating system. Keep as empty string and
// leave $CSVLINE unchanged, to get text file
// terminations for your server's operating system.
// (Line feed on UNIX, carriage-return line feed on Windows).
$CSVLINE = "\n"; // line termination for CSV files. The default is
// a single line feed, which may be modified for your
// server's operating system. If you want to change
// this value, you *must* set $CSVOPEN = "b".[/code]
The section giving the error looks like this with the "if" part being Line 5439:
[code=php]{
global $TARGET_URLS;
foreach ($TARGET_URLS as $s_prefix)
if (!empty($s_pref ix) &&
strtolower(subs tr($s_url,0,str len($s_prefix)) ) ==
strtolower($s_p refix))
return (true);
return (false);
}[/code]
I don't know what's wrong with this. More bizarrely, when I remove this CSV modification and revert to the original script, this error stays! I'm not a programmer so I'm a bit stuck here. I'm just trying to use the script as an "out-of-the-box" solution.
Any help greatly appreciated.
Dave
Comment