简体   繁体   English

解析错误:语法错误,意外的'(',在第26行的-------------- / admin.php中期望T_STRING

[英]Parse error: syntax error, unexpected '(', expecting T_STRING in --------------/admin.php on line 26

i uploaded file but it show error. 我上传了文件,但显示错误。

Parse error: syntax error, unexpected '(', expecting T_STRING in ///admin.php on line 26 how can fix this error? 解析错误:语法错误,意外的'(',期望在第26行的///admin.php中出现T_STRING,如何解决此错误?

line is 线是

function index($success){
    include("header.php");
    global $link,$prefix;
    if (isset($success)) {
        openTable();
        echo "<center><font color='#FF0000'>$success</font><center><br>";
        closeTable();
        echo"<br>";
        goto("index.php?file=admin");/  error line
    }

Most probably you're using PHP 5.3, where goto is an operator and in that line you're calling a custom function goto() , which you've defined. 很可能您使用的是PHP 5.3,其中goto是运算符,并且在那一行中您要调用已定义的自定义函数goto()

Solution: rename your function , something like go_to() will help. 解决方案: 重命名函数 ,类似go_to()会有所帮助。

Please refer PHP manual for goto here: http://php.net/manual/en/control-structures.goto.php goto参考PHP手册: http//php.net/manual/en/control-structures.goto.php

goto is used to shift execution to a different point in the same code file and you need to specify an identifier for another location in your code in the same file (refer to the example given in the PHP manual link). goto用于将执行转移到同一代码文件中的另一点,并且您需要为同一文件中代码中的其他位置指定标识符(请参阅PHP手册链接中给出的示例)。 If you want to go to another link, use header() method instead. 如果要转到另一个链接,请改用header()方法。

header("Location:index.php?file=admin");

Manual here: http://php.net/manual/en/function.header.php 此处的手册: http : //php.net/manual/zh/function.header.php

I've never used goto, but I just looked it up in the manual and they never used brackets around the destination. 我从未使用过goto,但我只是在手册中进行了查找,他们也从未在目的地周围使用方括号。 However if you want to redirect to another page, I think you're using the wrong method. 但是,如果您想重定向到另一个页面,我认为您使用的是错误的方法。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 解析错误:语法错误,意外的“ href”(T_STRING),期望为“,”或“;” - Parse error: syntax error, unexpected 'href' (T_STRING), expecting ',' or ';' 解析错误:语法错误,意外&#39;require&#39;(T_REQUIRE),期望在第203行的ComposerAPI.php中的标识符(T_STRING) - Parse error: syntax error, unexpected 'require' (T_REQUIRE), expecting identifier (T_STRING) in ComposerAPI.php on line 203 解析错误:语法错误,意外的T_STRING,期望为&#39;,&#39;或&#39;;&#39; 在第24行的C:\\ wamp \\ www \\ Giusti \\ AssignmentExample.php中 - Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\wamp\www\Giusti\AssignmentExample.php on line 24 PHP错误:“语法错误,意外的T_STRING,期望为&#39;,&#39;或&#39;;&#39;” - PHP error: “syntax error, unexpected T_STRING, expecting ',' or ';'” 解析错误:语法错误,意外T_VARIABLE,期望PHP 5.3中的T_STRING - Parse error: syntax error, unexpected T_VARIABLE, expecting T_STRING in PHP 5.3 php解析错误:语法错误,意外的T_STRING,在构造上需要T_FUNCTION - php Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION on construct PHP后期静态绑定—分析错误:语法错误,意外的T_STRING,预期的T_VARIABLE - PHP Late Static Binding — Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE PHP解析错误:语法错误,意外的T_STRING,预期的T_FUNCTION - PHP Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION PHP-解析错误:语法错误,意外的“ readphp”(T_STRING),期望为“,”或“;” - PHP- Parse error: syntax error, unexpected 'readphp' (T_STRING), expecting ',' or ';' 解析错误:语法错误,第6行意外T_STRING - Parse error: syntax error, unexpected T_STRING on line 6
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM