Is there PHP solution for my problem ? Need Help !

 

Results 1 to 2 of 2
I was coding somethng for my personal project, and now i need create automaticaly Fortumo ...
  1. #1
    snakeccc's Avatar
    snakeccc is offline Junior Member
    Join Date
    Jan 2012
    Location
    Bosna and Hercegovina
    Posts
    109
    Thanks
    37
    Thanked 51 Times in 13 Posts

    Default Is there PHP solution for my problem ? Need Help !

    I was coding somethng for my personal project, and now i need create automaticaly Fortumo script for every user on registracion.

    So this is SMS script that i need to create unique for every user..Unique param for every user is Fortumo Api Secret code. I'am noob now when i need to do that Every good replay can help. Thanks
    Code:
    <?php
     
      //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 = ' '; // secret between '' <------ UNIQUE FOR EVERY USER!
      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 = "Thank you $sender for sending $message";
     
      // 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);
      } 
    ?>
    
    Last edited by jazzc; 12-03-2012 at 03:27 PM. Reason: Added code tags




  2. #2
    alias_unknown is offline Newbies
    Join Date
    Dec 2012
    Posts
    34
    Thanks
    3
    Thanked 4 Times in 4 Posts

    Default Re: Is there PHP solution for my problem ? Need Help !

    I'd approach it by storing the API keys etc for each user in a database table. Then with the script above I would send in a user id (which appears to be the sender id in the script), with this user id I would pull all the necessary keys from the table and put it into the variables on the page. You don't need to have a separate script for each user. What needs to be done is basic PHP / MySQL skills.

Similar Threads

  1. JS/HTML/PHP prof to find a solution ...
    By Tanyusha in forum Hire a Freelancer
    Replies: 0
    Last Post: 03-06-2012, 04:48 PM
  2. [WordPress] Need Solution to Problem
    By kzonlertsgo in forum Blogging
    Replies: 1
    Last Post: 10-25-2011, 12:59 PM
  3. TBS Problem - Need Strategic Solution
    By bisnitch in forum Black Hat SEO Tools
    Replies: 0
    Last Post: 08-13-2011, 03:41 PM
  4. SB problem - who has the solution?
    By albaniax in forum Black Hat SEO Tools
    Replies: 3
    Last Post: 01-01-2011, 05:23 PM
  5. Cheapest Hosting Solution with PHP support??
    By phrasion in forum Web Hosting
    Replies: 4
    Last Post: 02-26-2010, 03:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




BlackHatWorld on Twitter BlackHatWorld on FaceBook


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98