Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
448 views
in Technique[技术] by (71.8m points)

php - 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>
<HEAD>
<TITLE> untitle </TITLE>
<meta http-equiv="Content-Type"  content="text/html; charset={$this -> Charset}">
</HEAD>
<BODY>
";
        echo "<Script Language="Javascript">history.go(-1)</Script>";
        echo "
</body></html>";
    }
    elseif

How should I change my syntax? Thanks a lot!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...