我想在我的网站上添加"使用Facebook登录"的功能.但是当我在Facebook Apps中注册我的网站时,我很困惑.我应该输入App Domains
什么?
我在AngularJS中有简单的应用程序.我想在发出AJAX请求时动态显示消息.不幸的是,它始终处于隐藏状态,我无法弄清楚原因.
HTML:
<div ng-show="message">
<h2>show</h2>
</div>
<div ng-hide="!message">
<h2>Hide</h2>
</div>
Run Code Online (Sandbox Code Playgroud)
AngularJS控制器:
function merchantListController($scope, $http, $rootScope, $location, global) {
$http({
method: 'POST',
url: global.base_url + '/merchant/list',
}).success(function($data) {
if ($data.status === 'success') {
$scope.merchants = $data.data;
$scope.$apply(function(){
$scope.message = true;
});
}
});
}
Run Code Online (Sandbox Code Playgroud)
我对php手册中的一个例子感到困惑.这是关于可见性的.这是一个例子.
class Bar {
public function test() {
$this->testPrivate();
$this->testPublic();
}
public function testPublic() {
echo "Bar::testPublic\n";
}
private function testPrivate() {
echo "Bar::testPrivate\n";
}
}
class Foo extends Bar {
public function testPublic() {
echo "Foo::testPublic\n";
}
private function testPrivate() {
echo "Foo::testPrivate\n";
}
}
$myFoo = new foo();
$myFoo->test();
?>
Run Code Online (Sandbox Code Playgroud)
http://www.php.net/manual/en/language.oop5.visibility.php
这个例子输出
Bar::testPrivate
Foo::testPublic
Run Code Online (Sandbox Code Playgroud)
请问你能解释一下这是怎么回事吗?
为什么两个testPublic()
都不叫?
我把一个var_dump($this)
Bar类构造.它打印object(Foo)[1]
.我所知道的是私有属性可以用同一个类调用.
然后如何Bar::testPrivate
调用" "?
session在我的登录脚本中没有被唤醒.这段代码有什么问题.当我在同一个文件中回显$ _SESSION ['userid']时,它会显示用户ID.但当我回复另一个文件时,没有任何回复.
<?php
session_start();
include '../../classes/check.class.php';
include '../../classes/user.class.php';
$check = new Check();
$user = new User();
$email = $_REQUEST['txtEmail'];
$password = $_REQUEST['txtPassword'];
$userid = $check->validateUser($email, $password);
if($userid){
$_SESSION['userid'] = $userid;
$url = '../../index.php';
header("Location: $url");
}else{
header("Location: $url");
}
Run Code Online (Sandbox Code Playgroud) 我上传文件后发生了这种错误.但是我的localhost没有任何错误.这有什么错误?如何解决这个问题?
警告:session_start()[function.session-start]:无法发送会话cookie - 在/ home/lahiruca/public_html中已经发送的标题(在/home/lahiruca/public_html/events/includes/links.php:1中开始输出)第1行的/events/includes/header.php
(来自评论)
<?php session_start();?>
<div class="header">
<div class="logo"></div>
<div class="right_header">
<div class="top_right_header">
<ul> <?php if(isset($_SESSION['userid'])){ ?>
Run Code Online (Sandbox Code Playgroud) 我正在调试这个问题两天,但我找不到任何问题.请指导我做错了什么?
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
'CURLOPT_RETURNTRANSFER' => 1,
'CURLOPT_URL' => 'https://api.instagram.com/v1/users/self/feed?access_token=' . $tocken,
));
$respond = curl_exec($curl);
if(!$respond){
echo curl_error($curl);
exit;
}
curl_close($curl);
var_dump(json_decode($respond, true));
Run Code Online (Sandbox Code Playgroud)
我收到了这个错误.
警告:curl_setopt_array()[function.curl-setopt-array]:数组键必须是CURLOPT常量或第8行/home/..../test.php中的等效整数值没有设置URL!