astroport/www/LOVELand/zen_loveland_entrance.php

17 lines
427 B
PHP
Raw Normal View History

2020-05-13 13:04:49 +02:00
<?php
header("Access-Control-Allow-Origin: *");
2020-05-13 13:07:45 +02:00
if (strlen($_REQUEST['phone']) == 10 ) {
2020-05-13 13:04:49 +02:00
// Replace leading 0 with +33
2020-05-13 13:07:45 +02:00
$newNumber = preg_replace('/^0?/', '+33', $_REQUEST['phone']);
2020-05-13 13:04:49 +02:00
// HASH NUMBER
$HASH=hash('sha256', $newNumber);
// CREATE FILE for POST TREATMENT with sms_ASTROPORT.sh
$fp = fopen('/tmp/loveland_entrance/'.$HASH, 'a');
fwrite($fp, $newNumber);
return true;
} else {
return false;
}
?>