草庐IT

Application_name

全部标签

php - 从 $_SERVER ['SERVER_NAME' 中删除子域]

我需要制作一个脚本,它将从$_SERVER['SERVER_NAME']中删除子域,以便在setcookie函数的域选项上使用它,以允许在所有可能的子域上访问cookie。例如,假设我有functionstrip_out_subdomain($domain){//dosomethingtoremovesubdomainreturn$only_my_domain;}$domain=strip_out_subdomain($_SERVER['SERVER_NAME']);setcookie('mycookie','123',time()+3600,'/',$domain);这里的主要问题是

php - oci_bind_by_name 和 to_date PHP/OCI/Oracle

我有以下内容:$ARTIFACT_NAME=$_POST['ArtifactName'];$ARTIFACT_TYPE=$_POST['ArtifactType'];$ARTIFACT_LOCATION=$_POST['ArtifactLocation'];$ARTIFACT_DOMAIN=$_POST['ArtifactDomain'];$ARTIFACT_AUTHOR=$_POST['ArtifactAuthor'];$ARTIFACT_LABEL='DB_'.$ARTIFACT_LOCATION.'_'.$ARTIFACT_DOMAIN.'_'.$ARTIFACT_NAME;$A

javascript - 文件获取内容 ('php://input' );使用 application/x-www-form-urlencoded;

我在这里阅读了一些关于该主题的问题,但找不到我正在寻找的答案。我正在用jQuery将一些$.post发送到PHP5.6服务器。$.post('/',{a:100,b:'test'},function(data){},'json');控制台的编码是Content-Typeapplication/x-www-form-urlencoded;charset=UTF-8如果我尝试使用常规$_POST读取POST数据,PHP5.6会提醒我PHPDeprecated:Automaticallypopulating$HTTP_RAW_POST_DATAisdeprecatedandwillberem

php - Facebook OAuthException : "user hasn' t authorized the application to perform this action"

使用FacebookPHPSDK,当我尝试发布状态更新时出现以下错误:Fatalerror:UncaughtOAuthException:(#200)Theuserhasn'tauthorizedtheapplicationtoperformthisaction这些是我采取的步骤:获取代码:https://graph.facebook.com/oauth/authorize?client_id=FB_APP_ID&redirect_uri=REDIRECT_URI获取访问token:https://graph.facebook.com/oauth/access_token?client

php - curl -X POST -H 'Content-Type: application/json' -d 到 PHP

我需要发出curl请求,我有这一行“curl-XPOST-H'Content-Type:application/json'-d”并且需要“翻译”为PHPcurl。问题是我不知道“-X”、“-H”和“-d”是什么意思。curl_setopt($ch,CURLOPT_HTTPHEADER,array('Accept:application/json','Content-Type:application/json','Content-Length:'.strlen($itemJson)));我在标题上尝试了类似的东西($itemJson是一个JSON字符串)但是我得到了错误400。我认为我以

php - 如何在 PHP 5.6 中通过 php.ini 设置 'verify_peer_name=false' SSL 上下文选项

案例:我想打开到localhost的SSL连接,而SSL证书是FQDN的问题。问题:如果(*)行中没有特殊处理,下面的程序将失败并显示以下消息:PHP警告:stream_socket_enable_crypto():对等证书CN='myhost.com'与test.php中预期的CN='localhost'不匹配测试PHP程序:$fp=stream_socket_client("tcp://localhost:993",$errno,$errstr,30);//(*)ifcommented,theprogramfails//stream_context_set_option($fp,'

mysql - 错误 : select command denied to user '<userid>' @'<ip-address>' for table '<table-name>'

在我的网站中,我使用的是MySQL数据库。我正在使用一个网络服务,我在其中进行所有与数据库相关的操作。现在在该网络服务的一种方法中,我收到以下错误。selectcommanddeniedtouser''@''fortable''可能出了什么问题?以下是我收到该错误的代码。我尝试调试,发现它在该行失败MySqlDataReaderresult1=command1.ExecuteReader();这是我的代码:StringaddSQL="SelectMax(`TradeID`)from`jsontest`.`tbl_Positions";MySqlConnectionobjMyCon=ne

mysql - 错误 : select command denied to user '<userid>' @'<ip-address>' for table '<table-name>'

在我的网站中,我使用的是MySQL数据库。我正在使用一个网络服务,我在其中进行所有与数据库相关的操作。现在在该网络服务的一种方法中,我收到以下错误。selectcommanddeniedtouser''@''fortable''可能出了什么问题?以下是我收到该错误的代码。我尝试调试,发现它在该行失败MySqlDataReaderresult1=command1.ExecuteReader();这是我的代码:StringaddSQL="SelectMax(`TradeID`)from`jsontest`.`tbl_Positions";MySqlConnectionobjMyCon=ne

PHP curl 将 Content-Type 更改为 application/x-www-form-urlencoded。不应该那样做

我想从我使用PHPcurl的服务器将视频直接上传到Youtube。我需要这种请求格式:POST/feeds/api/users/default/uploadsHTTP/1.1Host:uploads.gdata.youtube.comAuthorization:BearerACCESS_TOKENGData-Version:2X-GData-Key:key=adf15ee97731bca89da876c...a8dcSlug:video-test.mp4Content-Type:multipart/related;boundary="f93dcbA3"Content-Length:19

PHP fatal error : I'm trying to implement a Form\AbstractType in my Symfony2 application

我收到以下错误:Fatalerror:DeclarationofBean\OauthServerBundle\Form\Type\AuthorizeFormType::buildForm()mustbecompatiblewithSymfony\Component\Form\FormTypeInterface::buildForm(Symfony\Component\Form\FormBuilderInterface$builder,array$options)insrc/Bean/OauthServerBundle/Form/Type/AuthorizeFormType.phponl