草庐IT

get_token

全部标签

php - Doctrine DQL 无效参数编号 : number of bound variables does not match number of tokens

我在这个查询中收到错误无效的参数编号:绑定(bind)变量的数量与标记的数量不匹配。我真的没有看到问题,有什么想法吗?publicfunctiongetByPartial($q,Company$company){$query=$this->createQueryBuilder('u')->join('u.company',':company')->where('u.firstNameLIKE:q')->orWhere('u.lastNameLIKE:q')->setParameters(array('company'=>$company,'q'=>'%'.$q.'%'))->getQu

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 Guzzle 客户端错误响应/错误请求 400 Google OAuth2 token

Guzzle请求try{$url='https://www.googleapis.com/oauth2/v1/tokeninfo?';$client=newClient();$request=$client->createRequest('GET',$url);$query=$request->getQuery();$query['access_token']=$access_token;$response=$client->send($request);$json=$response->json();if(!empty($json)&&!isset($json['error'])){

php - Laravel 和 Dropbox WebAuth : "Missing CSRF token in session"

我正在使用Laravel5.0并尝试使用Dropbox进行授权。我松散地遵循这个例子:http://dropbox.github.io/dropbox-sdk-php/api-docs/v1.1.x/class-Dropbox.WebAuth.html当我进入/start时。我被重定向到Dropbox并单击“允许”,但是当我被重定向回/finish时,我一直在session中收到MissingCSRFtoken。有人有什么想法吗?我读过$_SESSION在Laravel中不起作用,但我不确定还有什么办法可以解决它。这是我正在使用的代码:publicfunctionstart(){$au

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 - Symfony2功能测试Unreachable字段 "_token"

我正在使用Liipfunctionaltestbundle在Symfony中创建一个功能测试.我目前无法提交表单。我正在尝试使用功能测试添加一个新的“日志”。如果我尝试通过UI添加新日志,我会收到以下请求参数:'WorkLog'=>array('submit'=>'','hours'=>'8','minutes'=>'0','note'=>'sometext','_token'=>'4l5oPcdCRzxDKKlJt_RG-B1342X52o0C187ZLLVWre4');但是当测试提交表单时,我得到相同的参数但没有token'WorkLog'=>array('submit'=>'',

php - file_get_contents https 超时 1 分钟?

当通过https访问某些资源时,我遇到了PHP的file_get_contents挂起60秒的问题。我不确定这是客户端还是服务器端问题。在客户端在命令行上工作:$URL="https://example.com/some/path"$wget"$URL"-O/dev/null-q#takesafewmilliseconds$curl"$URL">/dev/null#takesafewmilliseconds$php-r'file_get_contents("'"$URL"'")'#takes61s!在服务器上为正确的SSLvhost立即向Apache(2.4)访问日志写入一行,并返回2

PHP:$_GET 中的奇怪字符串编码

我有以下字符串由客户端发送到服务器:3%D3%E1f%7C%AF%B0a%B58%81%92%F9M%90%0CD%A0Y%9C//stringintheactualURL3Óáf|¯°aµ8’ùMDYœ//var_dump($_GET)原始字符串应该是:33D3E1667CAFB061B5388192F94D900C44A0599C我的问题是我不知道如何对此进行编码/解码以便我可以执行数据库搜索,因为归类类型不匹配。我尝试了urlencode/urldecode、mb_string_convert、utf8_encode、iconv,但是没有运气。有什么想法吗?Laravel在尝试使