草庐IT

input_parameter

全部标签

php - 为什么当我手动为 $_POST 数组赋值时 filter_input() 返回 NULL?

我正在做一些关于数据验证的练习,并决定弄乱filter_input()函数。当我尝试运行这段代码时:$_POST['var']=10;$filtered=filter_input(INPUT_POST,'var',FILTER_VALIDATE_FLOAT);var_dump($filtered);var_dump($filtered)返回NULL。我知道如果通过提交表单为$_POST['var']分配了一个值,代码就可以工作,但我只是想知道为什么手动为$_POST[]数组不返回float(10)? 最佳答案 filter_inpu

php - Zend 框架 : what is the right place to validate user input?

我想通过像'/index/adduser/id/7'这样的链接在用户表中添加一个用户。问题我应该在Controller内或模型文件内的某个地方验证“adduserAction”函数内的用户输入吗?我已经将包含数据库相关函数的文件放在“模型”目录中。假设通过“id”将用户添加到表中。此ID通过“get”发送。最后通过“AddUser”函​​数(在模型文件中)将其添加到表中。那么我应该在“adduserAction”或“AddUser”中验证这个“id”。?在可扩展性方面,在“AddUser”中执行会更好吗? 最佳答案 有一种流行的信念

php - Codeigniter $this->input->post 始终为 FALSE

我正在尝试将httpRequest发送到codeigniterController函数。我正在使用REST控制台来测试该功能。我正在尝试发送3POST变量。用户名电子邮件用户名这是处理请求的代码publicfunctionNewUser(){if($this->input->post()){$FID=$this->input->post('UserID');$UserName=$this->input->post('UserName');$Email=$this->input->post('Email');echo"working";echo$FID;echo$UserName;}el

php - 给出警告 : number_format() expects parameter 1 to be double, 字符串

关闭。这个问题需要debuggingdetails.它目前不接受答案。编辑问题以包含desiredbehavior,aspecificproblemorerror,andtheshortestcodenecessarytoreproducetheproblem.这将有助于其他人回答问题。关闭7年前。Improvethisquestion我的页面slider出现此错误:Warning:number_format()expectsparameter1tobedouble,stringgivenin/home/globalar/public_html/wp-content/themes/au

php - 更新 max_input_vars 后仍收到 "Input Variables Exceeded 1000"错误

我正在运行Magento,我收到“mod_fcgid:stderr:PHPWarning:Unknown:Inputvariablesexceeded1000.Toincreasethelimitchangemax_input_varsinphp.ini.inUnknownonline0”试图保存相关数据库中包含5000多种产品的产品。大多数人建议尝试通过将max_input_vars更新为更高的值来解决此问题。我继续将max_input_vars=100000添加到php.ini,并将php_valuemax_input_vars100000添加到.htaccess以获得良好的衡量标

php - Imagecreatefromwebp() : WebP decode: fail to decode input data

我正在尝试使用imagecreatefromwebp()将webp文件转换为JPEG,但不幸的是,它向我发出警告:警告:imagecreatefromwebp():WebP解码:无法解码输入数据。这是我的代码$filename=dirname(__FILE__)."\\".$keyword."1.webp";//$keyword='xyz';$im=imagecreatefromwebp($filename);//Convertittoajpegfilewith100%qualityimagejpeg($im,'./example.jpeg',100);imagedestroy($im

php - 奇怪的 PHP 错误 : function not recognizing its own parameter

我有以下功能:publicfunctionupdateCustomerInternetBanking($value,$column_to_go_by){$sql="UPDATEcustomercJOINaccount_importaiONc.account_import_id=ai.idJOINgeneric_importgiONai.generic_import_id=gi.idJOINimport_bundleibONgi.import_bundle_id=ib.idSEThas_internet_banking=1WHEREc.".$column_to_go_by."=".$th

php - 初学者 : Limit URL parameter by using regular expression

我需要一些关于正则表达式的帮助来限制用户为输入传递糟糕的参数时的选择。例如路径是这样的:/project/create/:category(:category是参数的占位符,因此我可以在我的Controller中访问它)基本上我想要做的是将URL与该类别的2个选项(报价|请求)之一相匹配。这使得用户尝试执行404重定向的任何其他路径都能正常工作。只允许这些选择的正则表达式需要是什么?(提供|请求)'/\/component\/create\/(offer|request)/'-会成功吗?提前致谢 最佳答案 从您表达问题的方式来看,您

PHP 错误 : Warning: ociparse() parameter 1 to be resource

由于oracle中没有现成的函数来验证如此创建的查询。所以我尝试了下面的代码来检查QUERY是否有效。if(isset($_POST['btn_Submit_Query'])){$check_query=$_POST['txtQuery'];echo$check_query;$valid=false;$stmt=oci_parse($DB,$check_query);echo"Statement".$stmt;//oci_define_by_name($stmt,'NUMBER_OF_ROWS',$number_of_rows);oci_execute($stmt,OCI_DEFAUL

nginx - Docker 的 php-fpm 错误 "no input file specified"

我正在尝试为php-fpm设置一个docker容器。但是在访问localhost配置的web目录时遇到这个错误。我已经被困在这里5个多小时了。这是我的Dockerfile:FROMcentos:latestWORKDIR/tmpRUNyum-yupdateRUNrpm-Uvhhttps://mirror.webtatic.com/yum/el7/epel-release.rpm;rpm-Uvhhttps://mirror.webtatic.com/yum/el7/webtatic-release.rpm#RUNyum-ygroupinstall"DevelopmentTools"RUN