STRING, expecting ']'
I am getting error on my site Parse error: syntax error, unexpected T_STRING, expecting ']' in /home/kbccsystem/kbccsystem.php.xdomain.jp/public_html/register.php on line 69
My PHP code in FROM line 69 to 96 is:
$allowedformat = array("gif" , "jpeg", "jpg" , "png");
$temp = explode(".", $_FILES["img_path"]["name"]);
$extension = end($temp);
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/jpg")
|| ($_FILES["file"]["type"] == "image/pjpeg")
|| ($_FILES["file"]["type"] == "image/x-png")
|| ($_FILES["file"]["type"] == "image/png"))
&& ($_FILES["file]["size"] < 20000 )
&& in_array($extension, $allowedformat)) {
if(is_uploaded_file($_FILES["img_path"]["tmp_name"]))
{
if(move_uploaded_file($_FILES["img_path"]["tmp_name"], "shop_image/" .$_FILES["img_path"]["name"]))
{
chmod("shop_image/" .$_FILES["img_path"]["name"], 0644);
echo "アップロードしました。";
}else{
echo "ファイルをアップロードできませんでした。";
}
}else{
echo "ファイルが選択されていません。";
}
}
}
Start line is 69. Last line is line 96.
please help :) thankyou.
The syntax highlighter shows your error. You're missing a quote around one of your array keys:
&& ($_FILES["file]["size"] < 20000 )
^^^^^
HERE
It should be:
&& ($_FILES["file"]["size"] < 20000 )
链接地址: http://www.djcxy.com/p/69706.html
上一篇: 解析错误:语法错误,意外的'[',期待')'PHP
下一篇: STRING,期待']'