我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

检查文件存在于变量中

Quite a simple one this I imagine.

I'm submitting a form with text and images.

I validate the text by checking the variable length !=0 etc.

I need an effective way to check if the variable that should have a file within does.

This is the code so far...

if(!$afterphoto){
    $form->setError($field, "After photo not entered");
}

This doesn't seem to be working, what would be a better checker?

Thanks.

Solution to this was to use the following code to check that there were no errors and the file was uploaded:

$afterphoto['error'] != 0

近期文章

  • 单击一个按钮时,php插入数据库行id和会话ID
  • HTML:显示来自单独PHP文件的字符串
  • CodeIgniter - 变量未定义
  • 将父URL复制到php变量
  • 如何创建重叠登录框
  • 使用两个变量连接URL
  • 从PHP获取XML请求的响应
  • 从Windows命令行CMD解雇php脚本
  • 如何从ash(bash)将数据发布到php
  • 如何使网站的SEO友好?
  • 在php标签内编写表单数据的正确方法
  • 如何使用爆炸或任何其他PHP爆炸看起来像 - [关闭]
  • 从Javascript调用PHP函数不起作用
  • 区分NULL和PHP中未定义
  • CodeIgniter URL使用RegEx数字和字母表进行路由
  • 如果清除状态等于1,则MYSQL选择student_id
  • SQL语句同一张表内如何同时取出ID和父ID的数据
  • scrapy 如何处理请求与请求之间的依赖关系
  • 支付宝微信支付同步通知成功后,还需要再请求服务器判断订单状态吗
  • linux转移当前目录下所有文件到上级目录?

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华