Reikia pagalbos su SMS sistema
Posted: 2014 Dec 20 20:08
Sveiki. Turiu tokį kodą, kuris turi nustatyti reklamą aktyve, bet man išsiuntus SMS žinutę parodo tokį pranešimą: "SMS Užsakymo tekstas neteisingas." SMS zinutes tekstas pvz: pmad 95
Štai mano kodas:
reklama_sms.php
config.php
functions.php
Štai mano kodas:
reklama_sms.php
Code: Select all
<?phpinclude "config.php";include "functions.php"; $sms = explode(" ", $_GET[wp_sms], 2);$sms[1] = strtolower($sms[1]); if(empty($sms[1])){ echo $ok .= "SMS Užsakymo tekstas neteisingas."; exit();} else { $r = mysql_query("SELECT id FROM `".DB_PREFIX."ads` WHERE id = '".$sms[1]."' LIMIT 1") or die( mysql_error()); $row = mysql_fetch_array($r, MYSQL_ASSOC); if($row){ mysql_query("UPDATE `".DB_PREFIX."ads` SET `rodyti`='1' WHERE `id`='".$sms[1]."'"); echo $ok .= "$msg3"; } else { echo $ok .= "Toks reklamos id ".$ex." nerastas."; }} ?>
Code: Select all
<?phprequire "../db_connect.php"; //Prisijungimo prie duomenu bazes failas $msg3 = "Reklama sėkmingai užsakyta. Ačiū, kad naudojatės mūsų paslaugomis. http://www.PRAMOGAUJAM.eu"; // Reply sms message if player successful unbanned $connect = mysql_connect($db_host,$db_user,$db_pass) or die(mysql_error());$select = mysql_select_db($db_name, $connect) or die(mysql_error()); ?>
Code: Select all
<?php $ok = "OK "; function checkip() { $ip = $_SERVER['REMOTE_ADDR']; if(!in_array($ip, array('195.216.233.20', '195.216.233.21', '195.216.233.22', '195.216.233.23', '195.216.233.24', '212.122.89.91'))) { exit('Access denied! Code:01'); }} function getCert($cert = null) { $fp = fsockopen("downloads.webtopay.com", 80, $errno, $errstr, 30); if (!$fp) exit("Cert error: $errstr ($errno)<br />\n"); else { $out = "GET /download/" . ($cert ? $cert : 'public.key') . " HTTP/1.1\r\n"; $out .= "Host: downloads.webtopay.com\r\n"; $out .= "Connection: Close\r\n\r\n"; $content = ''; fwrite($fp, $out); while (!feof($fp)) $content .= fgets($fp, 8192); fclose($fp); list($header, $content) = explode("\r\n\r\n", $content, 2); return $content; }} function checkCert($cert = null) { $pKeyP = getCert($cert); if (!$pKeyP) return false; $pKey = openssl_pkey_get_public($pKeyP); if (!$pKey) return false; $_SS2 = ""; foreach ($_GET As $key => $value) if ($key!='wp__ss2') $_SS2 .= "{$value}|"; $ok = openssl_verify($_SS2, base64_decode($_GET['wp__ss2']), $pKey); return ($ok === 1);} function goodRequest() { if (checkCert()) return true; return checkCert('public_old.key');} ?>