<? if (!isset($_SESSION)) { @session_start(); }
$urlAPI = "http://api.nabaztag.com/vl/FR/api.jsp"; $Serial = "0000000"; $Token = "1111111";
function get_content($url) { global $EtatComm; global $infoHTTP; global $infoERR;
$ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_setopt ($ch, CURLOPT_TIMEOUT, $curlTimeout); curl_setopt ($ch, CURLOPT_HTTPHEADER, array( "Content-Type: text/xml; charset=UTF-8", "Accept-Language: fr-fr", )); ob_start(); curl_exec ($ch); $infoHTTP = curl_getinfo($ch,CURLINFO_HTTP_CODE); $infoERR = curl_error($ch);
curl_close ($ch); $string = ob_get_contents(); ob_end_clean();
if (substr($infoHTTP,0,1) == "2") { return $string; } else { return false; } }
if (!isset($_SESSION['welcome'])) { $_SESSION['welcome'] = "ok";
$chor = "1";
$chor .= ",0,led,0,255,0,0"; $chor .= ",0,led,1,255,0,0"; $chor .= ",0,led,2,0,0,0"; $chor .= ",0,led,3,0,0,0"; $chor .= ",0,led,4,0,0,0";
$chor .= ",2,led,0,0,0,0"; $chor .= ",2,led,1,0,0,0"; $chor .= ",2,led,2,255,0,0"; $chor .= ",2,led,3,0,0,0"; $chor .= ",2,led,4,0,0,0";
$prevenir = get_content($urlAPI."?sn=".$Serial."&token=".$Token."&ttlive=86400&idapp=123&chortitle=WEB%20".rawurlencode($_SERVER['REMOTE_ADDR'])."&chor=".$chor); } ?>
|