草庐IT

mcrypt_get_iv_size

全部标签

php file_get_contents 向 Bugzilla 安装发送错误的内容类型

我正在创建一个脚本,该脚本应向bugzilla安装发送请求,以便登录用户并发布错误。我正在使用Google代码上提供的BugzillaPHPhttp://code.google.com/p/bugzillaphp/在我的本地服务器上一切正常,但在应该运行脚本的远程服务器上却不行。我从Bugzilla返回的错误是:Content-Typemustbe'text/xml,''multipart/*,''application/soap+xml,''or'application/dime'insteadof'application/x-www-form-urlencoded'这意味着我的脚本

PHP post_max_size 本地值被 Plesk/IIS 上的主值覆盖?

我在通过PHP(通过Drupal,尽管这不是问题所在)上传大文件时遇到了一个奇怪的问题。基本上,由于达到post_max_size限制,我的文件上传失败,即使本地指令设置为96M,而文件为25M。我已确保其他一切正确,包括max_input_time、max_upload_filesize和IISFastCGI空闲时间。所有这些都很大,不是问题。我正在通过Plesk覆盖post_max_size指令,它(我相信)将更改存储在注册表值中。在域上运行phpinfo()会显示所有指令的正确本地值和主值...96M本地值,12M主值。非常奇怪的是,当我将php.ini中的masterpost_

PHP 面向对象 : Get all declared classes which are have extended another parent class

我需要获取所有扩展了另一个父类的声明类。例如……classParentClass{}classChildOneextendsParentClass{}classChildTwoextendsParentClass{}classChildThree{}我需要一个输出这个的数组:array('ChildOne','ChildTwo')我是PHPOOP的新手,但基于一些谷歌搜索,我想到了这个解决方案。$classes=array();foreach(get_declared_classes()as$class){if(is_subclass_of($class,'ParentClass'))

php - PHP 会处理 $_GET 和 $_POST 中变量的字符编码吗? (PHP 5.4)

我的脚本是用UTF-8编写的,它使用的MySQL数据库表的排序规则是utf8_unicode_ci。现在,如果我想将$_GET/$_POST中的字符串与脚本/数据库中的“内部”字符串进行比较,甚至将某些内容放入数据库中,我是否必须检查/修复变量的编码还是PHP已经为我做了?如果是前者,我是否可以在脚本开头简单地执行以下操作?functioninputToUtf8($string){$detectedEncoding=mb_detect_encoding($string,'UTF-8,ISO-8859-1',true);if($detectedEncoding=='UTF-8'){ret

php - preg_replace file_get_contents 中不包含单词的所有链接

这个问题在这里已经有了答案:Regularexpressiontomatchalinethatdoesn'tcontainaword(33个答案)关闭9年前。我正在将一个页面读入一个变量,我想禁用地址中不包含单词“remedy”的所有链接。到目前为止,我的代码获取了所有链接,包括带有“补救措施”的链接。我做错了什么?$page=preg_replace('~(.*?)~i','$1',$page);--解决方案--$page=preg_replace('~(.*?)~i','$2',$page);

php - 如何从url中隐藏GET变量

我一直坚持这个"/>,我试图隐藏$_GET可变但没有成功。我想要实现的是www.mywebsitename.com/profile/name或www.mywebsite.com/name而不是profile.php?u=name有可能吗? 最佳答案 对于您的URL:http://localhost/ifinal/profile/myname您可以将like与htaccess一起使用:RewriteEngineOnRewriteBase/ifinal/RewriteCond%{REQUEST_FILENAME}!-fRewriteCo

php - 如何防止 curl 或 file_get_contents 从服务器端访问我的页面

我在大约2小时内遇到了一个问题。谁能提供解决方案,我将不胜感激。http://mydowmin.com/userdatapage.php注意:我不想使用Curl函数从外部世界访问此页面如何避免这个脚本$ch=curl_init("http://mydowmin.com/userdatapage.php");curl_setopt($ch,CURLOPT_CERTINFO,1);curl_setopt($ch,CURLOPT_VERBOSE,1);curl_exec($ch)ordie;print_r(curl_getinfo($ch));http://mydomain.com/data

PHP Predis : how to get/delete keys containing special characters?

我需要删除一个包含一些特殊键的键(在我的例子中是方括号):我做了以下,但它不起作用:$this->redis;$keys=$this->redis->keys("*");foreach($keysas$key){//keysareinthefollowingformat://vir3_data_cache[zones_cdc_shifting_series_2013_5][1]$this->redis->del($key);//nokeywasdeleted}我也尝试引用key,但没有成功:$this->redis;$keys=$this->redis->keys("*");forea

php - file_get_contents 的超时在 PHP 中不起作用

我创建了一个类来在PHP中包含一些HTTP方法。在这里,我有一个用于HTTPPOST的方法publicfunctionpost($content,$timeout=null){$timeInit=newDateTime();$this->method='POST';$header=array();$header['header']=null;$header['content']=is_array($content)?http_build_query($content):$content;$header['method']=$this->method;if($timeout!=NULL)

php - Node.js `crypto.final` 使加密结果与 PHP `mcrypt_encrypt` 不同

一开始,Node.js加密。//BothofkeyandIVarehex-string,butIhidetheminStackoverflow.varsecretKey=newBuffer('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa','hex'),//48charsiv=newBuffer('bbbbbbbbbbbbbbbb','hex');//16charsvarstr='Thisstringwillbeencrypted.';varcipher=crypto.createCipheriv('des-ede3-cbc',sec