Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Kod do wyslanie, Dla was to proste;p
quspy123
post
Post #1





Grupa: Zarejestrowani
Postów: 21
Pomógł: 0
Dołączył: 1.05.2010

Ostrzeżenie: (0%)
-----


Witam mam problem z serwisem fortumo wyslali mnie tutaj zeby was profesjonalistow poprosic o pomoc..a wiec prosze o pomoc a wiec
zrobilem sobie usluge na fortumo..ok wszystko super extra itp..
daje skrypt od nich na moja strone ok nie ma problemu
lecz jak wysle smsa zamist odpowiedzi dostaje"
Error:invalid signature"
poniezej zamiszczam skrypt:
  1. <?php
  2.  
  3. //set true if you want to use script for billing reports
  4. //first you need to enable them in your account
  5. $billing_reports_enabled = false;
  6.  
  7. // check that the request comes from Fortumo server
  8. if(!in_array($_SERVER['REMOTE_ADDR'],
  9. array('81.20.151.38', '81.20.148.122', '209.20.83.207'))) {
  10. die("Error: Unknown IP");
  11. }
  12.  
  13. // check the signature
  14. $secret = ''; // insert your secret between ''
  15. if(!empty($secret) && !check_signature($_GET, $secret)) {
  16. die("Error: Invalid signature");
  17. }
  18.  
  19. $sender = $_GET['sender'];
  20. $message = $_GET['message'];
  21.  
  22. // do something with $sender and $message
  23. $reply = "Thank you $sender for sending $message";
  24.  
  25. // print out the reply
  26. echo($reply);
  27.  
  28. //customize this according to your needs
  29. if($billing_reports_enabled
  30. && preg_match("/Failed/i", $_GET['status'])
  31. && preg_match("/MT/i", $_GET['billing_type'])) {
  32. // find message by $_GET['message_id'] and suspend it
  33. }
  34.  
  35.  
  36. function check_signature($params_array, $secret) {
  37. ksort($params_array);
  38.  
  39. $str = '';
  40. foreach ($params_array as $k=>$v) {
  41. if($k != 'sig') {
  42. $str .= "$k=$v";
  43. }
  44. }
  45. $str .= $secret;
  46. $signature = md5($str);
  47.  
  48. return ($params_array['sig'] == $signature);
  49. }
  50. ?>


Prosze mi "wskazac" gdzie mam dodac swoje kody..chodzi o to ze np
dodalem do bazy czy gdzies tam kody np:
123X/1KSD/2K3D
nastepnie system wysyla 1 KOD! do osoby ktora wyslala wiadomosc lecz nie wszystkie tylko1..!
jak to zrobic gdzie to dodac..?
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 20:53