ziedinjsh Posted June 29, 2012 Report Share Posted June 29, 2012 (edited) nū.. fortumo.. meiģināju šādi: <?php session_start(); include("misc/dbase.php"); $data = mysql_fetch_array(mysql_query("select * from peoples where email='".$_SESSION['email']."'")) or die(mysql_error()); //set true if you want to use script for billing reports //first you need to enable them in your account $billing_reports_enabled = false; // check that the request comes from Fortumo server if(!in_array($_SERVER['REMOTE_ADDR'], array('81.20.151.38', '81.20.148.122', '79.125.125.1', '209.20.83.207'))) { header("HTTP/1.0 403 Forbidden"); die("Error: Unknown IP"); } // check the signature $secret = '0f5c616b4bf25f5f73c77bbcc69fd1fa'; // insert your secret between '' if(empty($secret) || !check_signature($_GET, $secret)) { header("HTTP/1.0 404 Not Found"); die("Error: Invalid signature"); } $sender = $_GET['sender']; $message = $_GET['message']; $message_id = $_GET['message_id'];//unique id //hint:use message_id to log your messages //additional parameters: country, price, currency, operator, keyword, shortcode // do something with $sender and $message $reply = "Hej, ".$data['name']."! Tavs kods ir: ".$data['code']; // print out the reply echo($reply); //customize this according to your needs if($billing_reports_enabled && preg_match("/Failed/i", $_GET['status']) && preg_match("/MT/i", $_GET['billing_type'])) { // find message by $_GET['message_id'] and suspend it } function check_signature($params_array, $secret) { ksort($params_array); $str = ''; foreach ($params_array as $k=>$v) { if($k != 'sig') { $str .= "$k=$v"; } } $str .= $secret; $signature = md5($str); return ($params_array['sig'] == $signature); } ?> Our system didn't receive response from your script. Please, check if everything is ok. Edited June 29, 2012 by ziedinjsh Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted July 1, 2012 Author Report Share Posted July 1, 2012 Mjā.. forumā nekas te tāds nav atrodams, un atbildēt arī neviens neatbild.. Quote Link to comment Share on other sites More sharing options...
ezis Posted July 1, 2012 Report Share Posted July 1, 2012 Vaicāt pašiem fortumo, pirms rakstīji šeit, mēģināji? Quote Link to comment Share on other sites More sharing options...
daGrevis Posted July 1, 2012 Report Share Posted July 1, 2012 Un ir šeit atrodams! Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted July 1, 2012 Author Report Share Posted July 1, 2012 viņiem pašiem neesmu gan jautājis Quote Link to comment Share on other sites More sharing options...
y2ok Posted July 1, 2012 Report Share Posted July 1, 2012 Paskaties šo lapu - http://developers.fortumo.com/api/overview . Viss ir skaidri, un smuki aprakstīts. (P.S. Tur ir vairākas apakšlapas, kurās ir visa informācija). Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted July 3, 2012 Author Report Share Posted July 3, 2012 (edited) Fortumo baigi laipnie nav.. aizsūtīju e-pastu ar savu sms.php codu.. Adbildē saņēmtu to lai pārbaudot secret kodu vai viņš ie iekš '' un ip adresēm.. viņi pat kodu nepaskatījās!! ieejot pašā sms.php parāda: Error: Unknown IP tad viņiem ip adreses streiko nevs man kods nav riktīgs.. Edited July 3, 2012 by ziedinjsh Quote Link to comment Share on other sites More sharing options...
daGrevis Posted July 3, 2012 Report Share Posted July 3, 2012 Viņu uzdevums nav labot tavu līko kodu. Quote Link to comment Share on other sites More sharing options...
404 Posted July 3, 2012 Report Share Posted July 3, 2012 Adbildē saņēmtu to lai pārbaudot secret kodu vai viņš ie iekš '' un ip adresēm.. viņi pat kodu nepaskatījās!! ieejot pašā sms.php parāda: Error: Unknown IP tad viņiem ip adreses streiko nevs man kods nav riktīgs.. Omg! Tev kā programmētājam ar 562 postiem šis nav pamanāms? // check that the request comes from Fortumo server if(!in_array($_SERVER['REMOTE_ADDR'], array('81.20.151.38', '81.20.148.122', '79.125.125.1', '209.20.83.207'))) { header("HTTP/1.0 403 Forbidden"); die("Error: Unknown IP"); } Bet ja par tēmu tad viņu atbilde bija korekta. Debugo check_signature parametrus ja citādi vainu nevari atrast. Quote Link to comment Share on other sites More sharing options...
mad182 Posted July 3, 2012 Report Share Posted July 3, 2012 (edited) $_SESSION['email'] Kur tavuprāt tas varētu rasties, ja pieprasījumu uz šo failu veic fortumo serveris, nevis lietotājs? :) Un tev nav "jāiet" sms.php. Tas fails ir pieejams tikai fortumo webserverim. Lai apskatītos, vai tas viss strādā ir domāta testa iespēja fortumo lapā. Savu ūberkodu uzraksti atsevišķi, bez fortumo koda, notestē ar statisku parametru. Kad viss strādā, pieliec fortumo kodu un testē caur viņu lapu. Edited July 3, 2012 by mad182 Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted July 3, 2012 Author Report Share Posted July 3, 2012 es jau provēju pliku fortumo kodu ieliekot secret kodu un caur dashbord test sadaļās.. pasak ka nevar izveidot savienojumu un viss! Quote Link to comment Share on other sites More sharing options...
draugz Posted July 4, 2012 Report Share Posted July 4, 2012 Tajā skriptā ko tu norādi fortumo ieliec šitā <?php file_put_contents('debug.log', print_r($_SERVER, true)); die(); ?> Pēc tam kad pamēģināsi ar fortumo dashboard notestēt, paskaties, kas atrodams tavā debug.log Iespējams, ka viņi izsauc no kādas citas IP, iespējams parametri ne tādi... Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted July 4, 2012 Author Report Share Posted July 4, 2012 ieliku, bet log failu neuztaisa Quote Link to comment Share on other sites More sharing options...
ezis Posted July 4, 2012 Report Share Posted July 4, 2012 (edited) Our system didn't receive response from your script. Please, check if everything is ok. Kas tā par responsi? // this? $reply pareizi atbildi serverim? esi skatījies piedāvātos piemērus? Edited July 4, 2012 by ezis Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted July 5, 2012 Author Report Share Posted July 5, 2012 nū, viņi savā lapā neko par reply nav rakstījuši.. nav nekādu piemēru $reply = "Thank you $sender for sending $message"; echo($reply); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.