verifyResponse( $_SERVER["REMOTE_ADDR"], $_POST["g-recaptcha-response"] ); } if ($response != null && $response->success) { $statucaptchaf = 'captchaok'; }else{ $statucaptchaf = 'captchanok'; } return $statucaptchaf; } //////////////////////////////////////////////////////////////////////////////////////////////////// function alert($msg) { echo ""; } function macexitornot($mac){ // $messagereturnes $colors } if(isset($_POST['submitcheck'])){ $statucapcha = validationcaptch(); if($statucapcha == 'captchaok'){ $mac = $_POST['tvmac']; //$macsanslesdeuxpoints = ctype_xdigit(str_replace(':','',$mac)); if ( preg_match('/([0-9A-F]{2}:){5}[0-9A-F]{2}$/i', $mac) ){ $ipTV_db->query("SELECT * FROM `mac_smart_tv` WHERE `mac` = '%s' LIMIT 1", $mac); if( 0 < $ipTV_db->num_rows() ) { /// adresse MAC exite dans la base suive le traitement update infos server $user_info = $ipTV_db->get_row(); if ($user_info['pin'] == $_POST['pincode']){ $protocole = $_POST['protocol']; $hostnames = $_POST['hostname']; $port = $_POST['port']; $host = $protocole.$hostnames.":".$port; $username = $_POST['username']; $password = $_POST['password']; $ipTV_db->query('UPDATE `mac_smart_tv` SET `host` = \'%s\',`username` = \'%s\',`password` = \'%s\' WHERE `mac` = \'%s\'', $host, $username, $password, $mac); $colors = "green"; $messagereturnes = "Server Data Is Updated... !"; //$justupdate = "Server Data Is Updated."; }else { $colors = "red"; $messagereturnes = "Check Your Pin Code & Try Again !"; } }else { // adresse mac n'exsite pas donc un new adresse MAC /// remplisemnt donnée pour une premiere fois $jouradd = date('d-m-Y H:i:s'); $dateobj = new DateTime($jouradd); $dateobj->add(new DateInterval('P9D')); // P1D veut dire 1 Jour, P2D veut dire 2 jours ... $finDatetest = $dateobj->format('d-m-Y H:i:s'); // ensuite ici on le formate au format voulu echo $finDatetest; // Affichage du resutlat $pin = $_POST['pincode']; $macadress = $_POST['tvmac']; $host = $_POST['protocol'].$_POST['hostname'].":".$_POST['port']; $login = $_POST['username']; $pass = $_POST['password']; $datedajout = strtotime($jouradd); $datedafin = strtotime($finDatetest); $trial = 1; $remainingDays = 7; $status = 3; $countryCode = 'NA'; $ipTV_db->query('INSERT INTO `mac_smart_tv` (`pin`,`mac`,`host`,`username`,`password`,`exp_date`,`created_at`,`trial`,`remainingDays`,`status`,`countryCode`) VALUES(\'%s\',\'%s\',\'%s\',\'%s\',\'%s\',\'%d\',\'%d\',\'%d\',\'%d\',\'%d\',\'%s\')', $pin, $macadress, $host, $login, $pass, $datedafin, $datedajout, $trial, $remainingDays, $status, $countryCode); $colors = "green"; $messagereturnes = "Succes : Mac Address ".$_POST['tvmac']." Activated"; // For 3 Days."; } }else{ $colors = "red"; $messagereturnes = "Error : Invalid Mac Address.!!!"; } }else{ // captcha nok $colors = "red"; $messagereturnes = "Captcha: Validation Error: Value is required."; } } ?>


Please provide a valid Protocol.
Valid Host/IP is required.
Port required.
Valid Username is required.
Valid Password is required.
@ MAC
Your TV MAC is required.
Choose a Pin Code if Your Mac Address is Not Yet Activated
Pin code required.