草庐IT

out_param

全部标签

php - Zend Framework 路由 : unknown number of params

我正在尝试为N级类别深度编写路线。因此,通常的类别URL如下所示:http://website/my-category/my-subcategory/my-subcategory-level3/my-subcategory-level4它的深度未知,我的路线必须匹配所有可能的级别。我为此制定了路线,但无法从我的Controller获取所有参数。$routeCategory=newZend_Controller_Router_Route_Regex('(([a-z0-9-]+)/?){1,}',array('module'=>'default','controller'=>'index'

php - Mysqli 更新抛出 Call to a member function bind_param() 错误

这个问题在这里已经有了答案:Whattodowithmysqliproblems?Errorslikemysqli_fetch_array():Argument#1mustbeoftypemysqli_resultandsuch(1个回答)关闭3年前。我有一个70/80的字段表单,我需要将其插入到一个表中,所以我没有手动创建一个巨大的插入语句,而是首先根据表单中的输入名称在我的数据库中创建了一个表,这里是代码我用来创建/更改表的functioncreateTable($array,$memberMysqli){foreach($arrayas$key=>$value){//echo"K

php - 函数名($param, $line = __LINE__, $file = __FILE__) {};

是否可以让一个函数自动包含行号和调用该函数的文件,就像我在函数中调用__LINE__或__FILE__一样,它将使用函数定义所在的行和文件。但我不想每次都将__LINE__和__FILE__传递给函数。所以如果我将它们设置为默认参数,它们是来自函数定义,还是从哪里调用的? 最佳答案 按照您的建议行事似乎行不通。您可以这样做,但我不确定您为什么要这样做,并且没有更好的方法来实现您想要实现的目标-请参阅Wrikken'sanswer. 关于php-函数名($param,$line=__LIN

PHP mysqli bind_param 文本类型

对于将用户评论转储到MySQL表中的反馈表单,我不确定将哪种bind_param类型用于用户提供的反馈文本(MySQL字段类型=文本)functionsql_ins_feedback($dtcode,$custip,$name,$email,$subject,$feedback){global$mysqli;if($stmt=$mysqli->prepare("INSERTINTOfeedback(dtcode,custip,name,email,subject,feedback)VALUES(?,?,?,?,?,?)")){$stmt->bind_param("ssssss",$dt

php - 为什么我收到错误 "Commands out of sync; you can' t 现在运行此命令”

标题中提到的错误的文档说IfyougetCommandsoutofsync;youcan'trunthiscommandnowinyourclientcode,youarecallingclientfunctionsinthewrongorder.Thiscanhappen,forexample,ifyouareusingmysql_use_result()andtrytoexecuteanewquerybeforeyouhavecalledmysql_free_result().Itcanalsohappenifyoutrytoexecutetwoqueriesthatreturnd

php - mysqli_stmt_bind_param SQL注入(inject)

使用preparedstatements和mysqli_stmt_bind_param是否还有注入(inject)风险?例如:$malicious_input='bob";droptableusers';mysqli_stmt_bind_param($stmt,'s',$malicious_input);在幕后,mysqli_stmt_bind_param将此查询字符串传递给mysql:SET@username="bob";droptableusers";或者它是否通过API执行SET命令,或者使用某种类型的保护来防止这种情况发生? 最佳答案

file-upload - PHP fatal error : Out of memory (allocated 80740352) (tried to allocate 12352 bytes) in

当用户在我的网站上上传图片时出现此错误。错误消息是“PHPfatalerror:/home中内存不足(已分配80740352)(已尝试分配12352字节)......”我该如何使用php.ini解决这个问题?这是我当前的上传php.ini设置upload_max_filesize=2000M;post_max_size=2000Mmax_file_uploads=8有什么想法我还需要添加什么来解决这个错误吗? 最佳答案 最佳memory_limit值取决于您对上传文件的处理方式。您是使用file_get_contents还是GD库将

php - fsockopen() : unable to connect not work with PHP (Connection timed out)

我有这个代码:$domain='massag.com';$hosts=array();$mxweights=array();getmxrr($domain,$hosts,$mxweights);var_dump($hosts);var_dump($mxweights);$host=gethostbynamel($hosts[0])[0];var_dump($host);$f=@fsockopen($host,25,$errno,$errstr,10);if(!$f){var_dump('NOTCONNECTED');}它没有连接到smtp服务器但是当我使用命令时smtp:217.196

PHP bind_params 为空

如果该变量存在,我正在尝试将参数绑定(bind)到INSERTINTOMySQLi准备语句,否则插入null。这是我拥有的,但它不起作用:if(!empty($name)){$result->bind_param('ss',$name,$url_friendly_name);}else{$result->bind_param('ss',null,null);}if(!empty($description)){$result->bind_param('s',$description);}else{$result->bind_param('s',null);}有没有人知道这样做的更好方法,

php - 'echo' or drop out of 'programming' write HTML then start PHP code again

在大多数情况下,当我想显示一些要实际呈现的HTML代码时,我会使用“关闭PHP”标记,编写HTML,然后再次打开PHP。例如HTMLthatIwantdisplayed但我见过很多人只会使用echo来代替,所以他们会像上面那样做HTMLthatIwantdisplayed");//morephpcode?>他们会因为这样的退出和返回而影响性能吗?我假设不会,因为PHP引擎必须以任何一种方式处理整个文件。当你以一种看起来不像函数的方式使用echo函数时会怎样,例如echo"HTMLthatIwantdisplayed"我希望这纯粹是个人喜好问题,但我想知道我是否遗漏了什么。我个人认为第一