Let's take a look at the line in detail here
echo "<a href="javascript:history.go(-1)">Go Back</a>";
// ^ ^ ^ ^
See the four points which I marked with a ^ on the line below? This is where the problem lies. What's happening is you're telling the parser "what follows is a string" with the first double quote and then telling it "The string's finished now" with the second. This is not coprrect because the string is not finished the double quote is part of the string. The parser then expects php code after the second quote, when it doesn't find it it throws a parse error.
To get around this issue you must "escape" double quotes which are part of the sctring with a backslash (). So this line would look like.
echo "<a href=\"javascript:history.go(-1)\">Go Back</a>";
HTH
Bubble