sms_loveland.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. header("Access-Control-Allow-Origin: *");
  3. if ( ! isset($_REQUEST['phone']) ) {
  4. // DEBUG
  5. $_REQUEST['phone'] = "0612345678";
  6. $_REQUEST['parrain'] = "Inconnu";
  7. $_REQUEST['naissance'] = "06-06-2020_12:12";
  8. }
  9. if (strlen($_REQUEST['phone']) == 10 ) {
  10. // Replace leading 0 with +33
  11. $PHONE = preg_replace('/^0?/', '+33', $_REQUEST['phone']);
  12. $PARRAIN = $_REQUEST['parrain'];
  13. $naissance = $_REQUEST['naissance'];
  14. // HASH NUMBER
  15. $HPHONE=hash('sha256', $PHONE);
  16. // CREATE FILE for POST TREATMENT with "g1sms/sms_ASTROPORT.sh"
  17. mkdir("/tmp/loveland_entrance");
  18. $fp = fopen('/tmp/loveland_entrance/'.$HPHONE, 'w');
  19. fwrite($fp, $PHONE.'|'.$PARRAIN.'|'.$naissance);
  20. fclose($fp);
  21. chmod('/tmp/loveland_entrance/'.$HPHONE, 0777);
  22. echo "<!-- Matomo Tag Manager -->
  23. <script type='text/javascript'>
  24. var _mtm = _mtm || [];
  25. _mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
  26. var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
  27. g.type='text/javascript'; g.async=true; g.defer=true; g.src='https://piwik.p2p.legal/js/container_XDhfGZPj.js'; s.parentNode.insertBefore(g,s);
  28. </script>
  29. <!-- End Matomo Tag Manager -->";
  30. return true;
  31. } else {
  32. return false;
  33. }
  34. ?>