2
votes

I moved my website to another host. The previous php version is 5.2 and now is 5.3 When I login to my website, it shows the error:

Parse error: syntax error, unexpected T_GOTO, expecting T_STRING in /xx/xx/xx/xx on line xx

Following is the code, the first line is the error line:

    function goto($URL= "Back",$Target="self") //the error line
{
    if ($URL == "Back")
    {
        echo "<HTML>\n<HEAD>\n<TITLE> untitle </TITLE>\n<meta http-equiv=\"Content-Type\"  content=\"text/html; charset={$this -> Charset}\">\n</HEAD>\n<BODY>\n";
        echo "<Script Language=\"Javascript\">history.go(-1)</Script>";
        echo "\n</body></html>";
    }
    elseif

How should I change my syntax? Thanks a lot!

2
goto is a reserved keyword. You need to change the nameIkke

2 Answers

10
votes

rename your function to something other than "goto". That is a reserved name.

11
votes

For better or worse, goto is a reserved word in PHP 5.3.

http://php.net/manual/en/control-structures.goto.php