I have a php file. I get this error:
Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C:\wamp\www\spost.php on line 10
This is what on line 10 and before and after:
line 7:
$myFile = "servers.txt";
line 8:
$fh = fopen($myFile, 'a') or die("can't open file");
line 9:
$stringData = <<<EOD
line 10:
<a href="$_POST['title'].html">$_POST['title']</a><br> \n
line 12:
EOD;
line 13:
fwrite($fh, $stringData);
line 14:
fclose($fh);
I dont know what the problem is. I thought heredoc let me put variables in. I THINK it has
To do with the variables, because I took that block out and I got another error where another
variable was in yet another heredoc place.
What is the issue and how can I solve it?