我有DNS设置,如图像DNS设置中所示, 还有一个额外的CNAME,主机www和值作为我的GitHub页面.接下来,我在GitHub页面中设置了一个CNAME条目,其中包含我的域的顶点条目.我面临的问题是,每当我使用https协议访问我的域时,它都会显示连接不安全的警告.我在Chrome中获得以下内容:
NET :: ERR_CERT_COMMON_NAME_INVALID
我该如何解决?我的域名都有https和http访问权限.
我正在开发一个Android项目,我需要使用GCM来推送消息.我想只使用PHP而不是HTML发送通知.我该如何实现这一目标?我尝试的方式只是将gcm_regid和消息作为参数放到$ gcm-> send_notification($ registration_ids,$ msg)但我不断收到错误说: - 字段"data"必须是JSON数组:["你有一个通知!"]
在哪里"你有通知!" 是我的消息!! 请帮忙!!谢谢!
send_notification的代码是
public function send_notification($registatoin_ids, $message) {
include_once './config.php';
// Set POST variables
$url = 'https://android.googleapis.com/gcm/send';
$fields = array(
'registration_ids' => $registatoin_ids,
'data' => $message,
);
$headers = array(
'Authorization: key=' . GOOGLE_API_KEY,
'Content-Type: application/json'
);
// Open connection
$ch = curl_init();
// Set the url, number of POST vars, POST data
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Disabling SSL Certificate support temporarly
curl_setopt($ch, …Run Code Online (Sandbox Code Playgroud)