1

I have this error:

Parse error: syntax error, unexpected T_STRING in /home/u1/public_html/scripts/easypanel.php on line 192

When i run that on the local it's work, but on the real server it's not:

line 192 is:

if(isset($_POST['send_pass']))
{
    if($_POST['post_password'] == $password)
    {
        goto content;# = line 192   
    }
    else 
    {
        echo '<div class="box error">password incorrect</div><br>';
    }
}

...

content: 
    echo $content;

What's the problem?

10
  • 1
    Are you running PHP 5.3.0 or greater? <?php phpinfo() ?> Commented Aug 19, 2012 at 23:23
  • Odd that it is complaining of T_STRING when there is no string on that line or the previous (except the array key, which is valid). You're sure that is 192? Commented Aug 19, 2012 at 23:24
  • do u mean the syntax (goto) not work on the v5 or higher ? Commented Aug 19, 2012 at 23:27
  • hope this script is not part of an include? the line number may not be correct. Remove that line from your code and see if it still complains Commented Aug 19, 2012 at 23:29
  • no it's not, i check it(how i can use goto) by the a sample in php.net, but for test can u send me the correct one ? Commented Aug 19, 2012 at 23:37

2 Answers 2

2

The goto operator is available as of PHP 5.3.

Please check the version of your php on the local.

you can type php -v in the terminal to see the version.

Sign up to request clarification or add additional context in comments.

3 Comments

What sort of twisted language adds a goto statement as it matures?
Hi, guys .. my php v on the local is 5.3.0 & php v on the server is 5.2.17 .
so, there is another syntax for use goto on this version? or other question: can i update my php version in the server ? thank u
0

You said your server version is 5.2. Thats what creating the problem. "goto" was introduced in 5.3. So you can either ask for an upgrade of the server version or stop using goto altogether because 5.2 does not support it. It works fine on local because on local you are using PHP version 5.3

1 Comment

Great It was my pleasure. Please mark one of the answers as the chosen one now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.