开发者

syntax error, unexpected T_GOTO, expecting T_STRING

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!


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

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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜