I recommend using their official Javascript API https://developer.appear.in, add this to your HTML (has to run on HTTP or HTTPS protocol, file may not support):
<script src="//developer.appear.in/scripts/appearin-sdk.0.0.4.min.js"></script>
And then call it:
var AppearIn = window.AppearIn || require('appearin-sdk');
var appearin = new AppearIn();
// verifica se o navegador usa WebRTC
var isWebRtcCompatible = appearin.isWebRtcCompatible();
if (isWebRtcCompatible) {
//Cria uma sala
appearin.getRandomRoomName().then(function (roomName) {
//Após iniciar a sala
});
}
If you have a specific room do so:
<iframe id="meu-iframe"></iframe>
And in Javascript this:
var minhaSala = "rodrigo-fontes";
appearin.addRoomToElementById("meu-iframe", minhaSala);
But if you still need PHP for some reason, like creating rooms dynamically, the use of Curl is relatively simple, apparently you have to use HTTPS, so do it like this:
$nomedasala = 'nome da sala';
$url = 'https://appear.in/' . urlencode($nomedasala);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
//Define um User-agent
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 5.1; rv:21.0) Gecko/20100101 Firefox/21.0');
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
//Retorna a resposta
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//Resposta
$data = curl_exec($ch);
If you get an error message about SSL or HTTPS then it is because your server is off, you need to enable SSL module, see how to do here /a/169474/3635
But if you can’t do it at all you can just turn off the check (which I don’t recommend):
//Desliga
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
You know this is a GET method right? You just need to access the URL, for example,
https://appear.in/Rodrigo-Fontes
. When you "something" goes straight to "something".– Inkeliz