今天在写一个页面通过ajax使用post传递传递数据的时候,总是报一个错误,如图所示:

$_POST与input('post.')区别

我在控制层接收数据时,一段段的调试,发现在接收img图片的时候,出现了错误

 $img = empty(input('post.img')) ? null : (input('post.img');

我的接收数据的地方,统一都使用了input('post.‘’)接收数据。由于传递的img是数组的形式进行传递,input()无法接收数组出现的问题。所以将改为

 $img = empty($_POST['img']) ? null : $_POST['img'];

 就OK了!!

相关文章:

  • 2021-06-15
  • 2021-12-18
  • 2021-09-11
  • 2021-12-22
  • 2021-11-20
猜你喜欢
  • 2021-05-28
  • 2021-11-29
  • 2021-12-02
  • 2021-07-29
  • 2022-12-23
  • 2021-11-12
相关资源
相似解决方案