草庐IT

path-parameter

全部标签

php - 无法设置 PHP include_path

我已经在var/www/html中上传了我所有的文件,在我的一个php文件中我有这一行:require_once('libraries/stripe/init.php');我的文件夹结构如下:www-html/-libraries->Stripe->init.php-register.php我不断收到此错误消息:Warning:require_once(libraries/Stripe/init.php):failedtoopenstream:Nosuchfileordirectoryin/var/www/html/register.phponline116Fatalerror:req

php - 给出警告 : mysqli_free_result() expects parameter 1 to be mysqli_result, bool 值

这个问题在这里已经有了答案:Whattodowithmysqliproblems?Errorslikemysqli_fetch_array():Argument#1mustbeoftypemysqli_resultandsuch(1个回答)INSERTqueryproduces"Warning:mysqli_num_rows()expectsparameter1tobemysqli_result,booleangiven"(3个答案)关闭2年前。为什么我会收到此错误消息:Warning:mysqli_free_result()expectsparameter1tobemysqli_re

php - WAMP: "' php' 未被识别为内部或外部命令可运行程序或批处理文件”,尽管添加了 PATH

当我在CMD中运行PHP时,我收到此错误消息:'php'isnotrecognizedasaninternalorexternalcommandoperableprogramorbatchfile路径已经添加,我遵循了本教程:http://perials.com/install-composer-on-windows-and-wamp/C:\ProgramFiles(x86)\Lenovo\FusionEngine;C:\ProgramFiles(x86)\NVIDIACorporation\PhysX\Common;C:\ProgramFiles(x86)\Intel\iCLSCli

php - 拉维尔 5.4 : Exclude a route with parameters from CSRF verification

根据Laravel5.4Docs,您可以通过将路由添加到VerifyCsrfToken中间件的$except属性来从CSRF验证中排除路由。但是出于某种原因,除非从主路由本身中排除,否则无法使用确切的路由名称排除带有参数的路由。预期排除的路线:protected$except=['main/{id}/sub/*'];仅适用于:protected$except=['main/*'];如何从CSRF验证中排除带有参数的路由? 最佳答案 因为在引擎盖下这个功能使用request()->is()方法,也许这对你有用:protected$ex

PHP: print '<meta http-equiv="refresh"content ="0;url=' with URL parameters

如何使用URL参数创建此字符串?我想要的是这样的:print'';但这并没有正确地传递我的第二个参数。我得到一个“)”而不是一个b。我做错了什么?我试过&而不是&符号,但这也不起作用, 最佳答案 echo"";甚至header("Location:url=http://domain.com?a=1&b=2");因为你使用0作为延迟 关于PHP:print'<metahttp-equiv="refresh"content="0;url='withURLparameters,我们在St

php - 如何在 PHPSESSID cookie 中设置 PATH?

我的服务器上运行着许多项目,所有这些项目都使用PHPsession进行身份验证。现在,由于PHPSESSIDcookie将cookie路径设置为set-cookieheader中的“/”,因此该cookie在整个域中都可用,而我只需要它对当前应用程序可用。因此,出现了以下问题:登录mysite.com/application-1的用户会自动登录mysite.com/application-2mysite.com/application-3mysite.com/application-4..等等那么,如何设置PHPSESSIDcookie的路径? 最佳答案

php - 查询生成器 : parameters in a loop

我正在尝试使用SF2/DoctrineQuerybuilder为搜索字段构建请求。在我的搜索字段中,我希望能够输入多个关键字,并获得与所有关键字匹配的结果。所以,这是我的代码(在存储库中):foreach($keywordsArrayas$keyword){$qb->andWhere($qb->expr()->orX($qb->expr()->like('p.name',':keyword'),$qb->expr()->like('p.surname',':keyword')));$qb->setParameter('keyword','%'.$keyword.'%');var_dum

php - Silex check_path 验证用户登录的代码

我目前正在关注SecurityServiceProvider上的Silex教程.我有登录表单,使用此代码将我的check_path设置为/login_check:$app->register(newSilex\Provider\SecurityServiceProvider(),array('security.firewalls'=>array('admin'=>array('pattern'=>'^/contacts/add','form'=>array('login_path'=>'/login','check_path'=>'/login_check'),'users'=>arr

php - 在 composer 中设置 "config.fxp-asset.installer-paths"选项

当我运行composerupdate时,我会在继续更新之前收到以下警告。The"extra.asset-installer-paths"optionisdeprecated,usethe"config.fxp-asset.installer-paths"option我在哪里/如何更改这些设置? 最佳答案 将extra.asset-installer-paths部分替换为:"config":{"fxp-asset":{"installer-paths":{"npm-asset-library":"vendor/npm","bower-

php - 谷歌 API OAuth 2.0 CURL 返回 "Required parameter is missing: grant_type"

我正在尝试为Web服务器应用程序实现Google的OAuth2.0身份验证。我可以从Google获取代码,但是当我发回此代码以尝试获取访问token时,它总是给我错误“缺少必需的参数:grant_type。错误400”,即使grant_type存在。此外,如果我将内容长度指定为0以外的任何值,它会引发其他错误。这是执行此curl帖子的代码:$url='https://accounts.google.com/o/oauth2/token';$ch=curl_init($url);curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);curl_setop