草庐IT

invalid-name

全部标签

php - $_SERVER ['SERVER_NAME' ] 有什么好的替代品吗?

我在PHPdocpages上阅读了以下评论:"BewarnedthatmostcontentsoftheServer-Array(even$_SERVER['SERVER_NAME'])areprovidedbytheclientandcanbemanipulated.TheycanalsobeusedforinjectionsandthusMUSTbecheckedandtreatedlikeanyotheruserinput."然后我在这里看到了一个话题onStackOverflowsayingthat$_SERVER['SERVER_NAME']ispartlyservercon

php - 尝试发送模板时在 Mandrill 中出现 "invalid-sender"错误

我有4个模板,但其中一个返回错误:"reject_reason":"invalid-sender"。我没有发现这个错误。在文档中。我的帐户中有4个模板,当前模板具有以下结构:模板别名:contact-home发件人地址:info@somecomp.com发件人姓名:SOME_COMP++HTML模板。这是我从API日志发送的请求:完整请求{"template_name":"contact-home","template_content":[{"name":"examplename","content":"examplecontent"}],"message":{"dest_mail":

php - Zend Framework 2,教程中的 "resolves to invalid controller class or alias"博客模块

我一直在按照Zend主页(https://framework.zend.com/manual/2.4/en/in-depth-guide/first-module.html)的博客教程的步骤进行操作,但我遇到了这个错误:“解析为无效的Controller类或别名”。这是我的module.config.php:array(//Openconfigurationforallpossibleroutes'routes'=>array(//Defineanewroutecalled"post"'post'=>array('type'=>'literal',//Configuretheroute

php - Stripe 400 错误 "Invalid Positive Integer"

我有一个真正的问题。我正在尝试为一个通过Stripe向人们收费的非营利组织建立一个捐赠页面。我尝试进行的每一次收费都会给我一个错误,内容如下:已解析的请求帖子正文{"card":"TOKENWASHERE","description":"Donationby()","amount":"0","currency":"usd"}响应正文:{"error":{"type":"invalid_request_error","message":"Invalidpositiveinteger","param":"amount"}}我认为我传递给Stripe的金额有问题(显然Stripe认为它收到的

PhpStorm:获取 "Methods with the same name as their class will not be constructors"的代码检查警告

好吧,我终于切换到PHP7。我的代码有点旧,会被翻新。一些问题是:classMagicClassfunctionMagicClass(){//etc}在执行过程中给出弃用警告:Deprecated:MethodswiththesamenameastheirclasswillnotbeconstructorsinafutureversionofPHP;MagicClasshasadeprecatedconstructorin这很好:classMagicClassfunction__construct(){//etc}如何让PhpStorm代码检查来警告我当前代码库中的此类错误?

php - Nginx 为静态文件代理不正确的 fastcgi_script_name

server{listenloc.app:80;root/app/frontend/web;indexindex.php;location/{try_files$uri$uri//index.php$is_args$args;}location~^/admin{proxy_passhttp://127.0.0.1:81;}location~*\.php${#phpconf}}server{listen127.0.0.1:81;root/app/backend/web;indexindex.php;location/{try_files$uri$uri//index.php$is_arg

php - 创建 Google 联系人 --> 为什么只有 "NAME"没有插入新联系人?

这是我提出的要求:-//createnewentry$doc=newDOMDocument();$doc->formatOutput=true;$entry=$doc->createElement('atom:entry');$entry->setAttributeNS('http://www.w3.org/2000/xmlns/','xmlns:atom','http://www.w3.org/2005/Atom');$entry->setAttributeNS('http://www.w3.org/2000/xmlns/','xmlns:gd','http://schemas.go

PHP PDO : Charset=UTF8 : An invalid keyword charset was specified in the dsn string

我正在使用sqlsrv驱动程序连接到带有PDO的MSSQL服务器。PHP版本为5.3.24。工作连接如下所示:$dsny="sqlsrv:Server=xx1;Database=xx2";$usery='xx3';$passwordy='xx4';$dbhy=newPDO($dsny,$usery,$passwordy);**但是我需要设置字符,然后我试试这个:$dsny="sqlsrv:Server=xx1;Database=xx2;charset=utf8";$usery='xx3';$passwordy='xx4';$dbhy=newPDO($dsny,$usery,$passw

php - Drupal - 如何使用 taxonomy_get_term_by_name 从名称中获取术语 ID

我尝试使用以下代码从术语中获取termId:$term=taxonomy_get_term_by_name($address_string);$termId=$term[0]->tid;有1个结果,但它显示为term[30]-所以上面的代码不起作用。我以为我可以通过查看第一个元素来访问术语数组-例如$term[0]我做错了什么?这是var_dump($term)的结果:array(size=1)30=>object(stdClass)[270]public'tid'=>string'30'(length=2)public'vid'=>string'4'(length=1)public'

PHP - $request->getPost ('first_name' )

publicfunctionprocess(Zend_Controller_Request_Abstract$request){$this->first_name=$this->sanitize($request->getPost('first_name'));....}我的问题是$request是类zend_controller_request_abstract的一个实例,但是getpost是类zend_controller_request_http中定义的一个函数,它扩展了zend_controller_request_abstract,那为什么$request直接调用getPos