elfugo
1
Hello,
I am moving this code on a shared hosting, but the https call doesn’t work any more…
<form action="https://api.particle.io/v1/devices/DEVICE_ID_HERE/myFunction?access_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
method="POST" target="thisFrame" onsubmit="setTimeout(function(){reset();},1000);">
<input type="text" name="args" value="HELLO">
<input type="submit" value="SEND">
</form>
Need help
Thanks !
Moors7
2
Does the browser console say anything?
elfugo
4
The API call works on dedicated Linux hosting (Apache 2.4 + SSL/TLS Encryption)
but doesn’t work on Windows hosting (IIS 8.5)
elfugo
5
Hi All,
I solved rebooting the photon (strange ), but now I have another issue with the php version.
On my new hosting the PHP is v5.5.19 and the code below write…
Curl error: SSL certificate problem: unable to get local issuer certificate
<?php
$my_device = "xxxxxxxxxxxxxxxxxxxxxxxxxx";
$my_token = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy";
$url = "https://api.particle.io/v1/devices/".$my_device."/myFunction?access_token=".$my_token;
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, http_build_query(array('args' => $_POST["args"])));
$response = curl_exec( $ch );
if($response === false)
{
echo 'Curl error: ' . curl_error( $ch );
}
curl_close( $ch );
?>