PHP Syntax Check: Parse error: syntax error?

i get this error when using my php code

PHP Syntax Check: Parse error: syntax error, unexpected '}' in your code on line 7

please help me i dont understand what ive done wrong here php code :

<?php


if ( $ready == "false" ) { 
$rand =  chr(rand(97, 122)). chr(rand(97, 122)). chr(rand(97, 122)); 
$folder = "uploads/".$rand 
}

if ( !is_dir($folder) ) {
    $ready = "true"
}
if ( is_dir($folder) ) {
    $ready = "false"
}

if ( $ready == "true" ) {
$that = "yes"
mkdir("uploads/".$rand);
$to = "Uploads/".$_FILES["file"]["name"];
move_uploaded_file($_FILES["file"]["tmp_name"], $to);
echo "uploaded";
}
?>


<form method="post" enctype="multipart/form-data">
<label>Choose a file:</label>
<input type="hidden" name="upload" value="1">
<input type="file" name="file">
<input type="submit" value="upload" onclick="$other = "yes""/>

</form>

You have miss ; in many lines complete code:

if ( $ready == "false" ) { 
  $rand =  chr(rand(97, 122)). chr(rand(97, 122)). chr(rand(97, 122)); 
  $folder = "uploads/".$rand ;
}

if ( !is_dir($folder) ) {
    $ready = "true";
}
if ( is_dir($folder) ) {
    $ready = "false";
}

if ( $ready == "true" ) {
  $that = "yes";
  mkdir("uploads/".$rand);
  $to = "uploads/".$_FILES["file"]["name"];
  move_uploaded_file($_FILES["file"]["tmp_name"], $to);
  echo "uploaded";
}

您在第7行的末尾忘了分号。该语句不完整,因此解析器不会期望大括号。

if ( $ready == "false" ) { 
    $rand =  chr(rand(97, 122)). chr(rand(97, 122)). chr(rand(97, 122)); 
    $folder = "uploads/".$rand ;
}
链接地址: http://www.djcxy.com/p/69886.html

上一篇: PHP解析错误语法错误意外吨

下一篇: PHP语法检查:解析错误:语法错误?