草庐IT

Client_Pages

全部标签

php - 谷歌地图 PHP CURL 问题 "Your client has issued a malformed or illegal request. That’ s 我们都知道。”

我有一个使用CURL和GoogleMapsAPI返回地址坐标的函数。代码如下:functionget_coordinates($address_string){$address=urlencode($address_string);$url="https://maps.googleapis.com/maps/api/geocode/json?address=".$address."&key=".$api_key;$ch=curl_init();curl_setopt($ch,CURLOPT_URL,$url);curl_setopt($ch,CURLOPT_RETURNTRANSFER

php - 拉维尔 4 : Two different view pages for a single URI based on auth status

我最近开始使用Laravel4进行开发,我对路由有疑问。对于“/”,我希望根据用户的授权状态有两个不同的View页面。如果用户已登录并正在查看“/”,我想向他们展示一个带有管理控件的View,当用户在未登录的情况下以普通用户的身份查看“/”时,我想提供一个一般信息View。为了实现这一点,我一直在尝试使用过滤器“auth”和“guest”,但没有成功。//应用程序/routes.php//routeforloggedinusersRoute::get('/',array('before'=>'auth',function(){return'loggedin!';}));//fornor

php - 发生客户端错误 : Could not create storage directory:/tmp/Google_Client/00

此错误对YoutubeAPIv3.0意味着什么:Aclienterroroccurred:Couldnotcreatestoragedirectory:/tmp/Google_Client/00我在Google的文档中使用PHPYoutubeAPI找到here. 最佳答案 我在不更改GoogleAPI的任何行的情况下解决了这个问题。在您的PHP代码中,您只需要指定缓存文件夹所在的位置:$config=newGoogle_Config();$config->setClassConfig('Google_Cache_File',arra

php - 拉维尔 4 : Stock Auth login won't persist across pages

从所有教程中,我应该能够对用户进行身份验证,然后跳转到任何其他页面,并保持登录。然而,这不起作用。自定义编译的PHPLAMP堆栈。应用存储是可写的。与教程的唯一区别是我使用的是电子邮件而不是用户名。http://laravelbook.com/laravel-user-authentication/http://codehappy.daylerees.com/authenticationsession有效,因为我能够将var存储到session并在不同的页面上读出它。models/User.php(股票)useIlluminate\Auth\UserInterface;useIllum

php - [Microsoft][SQL Server Native Client 11.0][SQL Server]无效的对象名称

我想访问MSSQLServer并进行选择查询。我已经安装了dll文件并正在使用sqlsrv_query。连接成功但我得到:[Microsoft][SQLServerNativeClient11.0][SQLServer]Invalidobjectnameaserror我正在使用PHP5.3.1版连接后我有这段代码$sql="SELECTid,latitude,longitudefromjob";$stmt=sqlsrv_query($conn,$sql);if($stmt===false){die(print_r(sqlsrv_errors(),true));}while($row=s

php - 警告 : ssh2_connect(): Failed overriding server to client COMP method

我在为PHP中的SSHsession启用压缩时遇到问题。部分代码:$methods=array('server_to_client'=>array('comp'=>'zlib'));if(!($con=ssh2_connect("10.214.201.31",22,$methods))){...执行期间的警告(通过httpd或phpcli):Warning:ssh2_connect():FailedoverridingservertoclientCOMPmethod压缩不起作用(通过ssh2_scp_recv下载测试文件的时间没有改变)。设置客户端到服务器压缩后出现类似警告。PHPVe

php - GSC_Client 和 oAuth2 访问

我开始编写一个PHP脚本,该脚本将作为cron作业运行并通过Google购物API定期更新产品列表。我下载了GSCClientlibraryforPHP并且正在努力解决GoogleShoppingAPIdocumentation为了获得token。但是,感觉文档中某处缺少有关生成URL后如何实际请求token的步骤。到目前为止,这是我的代码:require("./lib/shoppingclient/GShoppingContent.php");constG_MERCHANT_ID='**********';constG_CLIENT_ID='**********';constG_CL

php - 使用 google-api-php-client 下载文件

我在尝试使用位于https://code.google.com/p/google-api-php-client/的php客户端从GoogleCloudStorage下载文件时遇到问题我已经验证了自己的身份,使用下面的代码我可以返回一个对象,其中包含指向我的文件的链接$this->storageService=newGoogle_StorageService($this->client);$this->objects=$this->storageService->objects;$options=array('prefix'=>'REPORT_NAME_2013-07-01');$buc

php - 401. 这是一个错误。错误 : invalid_client The OAuth client was not found

我正在按照此GoogleDriveFilePickerExample使用Google云端硬盘文件选择器演示项目。我已经生成了APIkey和客户端ID。但是当我运行该项目时,出现以下错误That’sanerror.Error:invalid_clientTheOAuthclientwasnotfound.我也检查了ThisGoogleDriveFilePickerExampleLink但它不起作用,请帮我解决我的问题。invalid_clientingoogleoauth2. 最佳答案 您的client_id不正确,请重新检查

php - Zend_Http_Client - 从 Stream 读取?

我想使用Zend_Http_Client访问新的TwitterStreamAPI。问题是,对该网页(http://stream.twitter.com/1/statuses/sample.json)的HTTP请求从未完成但一直在加载。所以即使我将Zend_Http_Client设置为setStream(),我也无法获取它发出的信息。这是我目前的逻辑:$httpClient=newZend_Http_Client("http://stream.twitter.com/1/statuses/sample.json");$httpClient->setAuth("username","pas