$ image变量在文件上传php上保持为空

时间:2018-06-20 11:29:06

标签: php image-uploading

$image未被分配任何东西。警报显示一个空字符串。更新查询工作正常。

  <?php
  if(isset($_POST['EditProfilebu']))
  {
      $id = $_GET['id'];
      $username = $_POST['Name'];
      $Email = $_POST['Email'];
      $PostalCode = $_POST['PostalCode'];
      $Address = $_POST['Address'];
      $text = $_POST['text'];
      $image = $_FILES['image']['name'];
      $image_tmp = $_FILES['image']['tmp_name'];
      move_uploaded_file($image_tmp,"images/$image");
       echo "<script>alert('$image')</script>";

      move_uploaded_file($image_tmp,"images/$image");
      $query = "update users set UserName='$username',UserEmail='$Email',Picture='$image',PostalCode='$PostalCode',Address='$Address',Text='$text' where UserId='$id'";
      $run = mysqli_query($mysqli,$query);
      if($run)
      {
          echo "<script>alert('Updated')</script>";
      }
  }
  ?>

0 个答案:

没有答案