56 lines
1.3 KiB
PHP
56 lines
1.3 KiB
PHP
|
<?php
|
||
|
// LOAD Twilio & Zebra Database
|
||
|
require __DIR__ . '/SMS/vendor/autoload.php';
|
||
|
include_once __DIR__ . '/SMS/config.php';
|
||
|
|
||
|
$to = "webmaster@zicmama.com"; // Your email address
|
||
|
$subject = "MadeInZion Banque Libre Contact";
|
||
|
|
||
|
if (isset($_REQUEST['phone'])) $phone = $_REQUEST['phone']; else $phone = "";
|
||
|
if (isset($_REQUEST['email'])) $email = $_REQUEST['email']; else $email = "";
|
||
|
|
||
|
$message = "Message de {$phone} / {$email}";
|
||
|
|
||
|
$headers = "From: webmaster@zicmama.com"; // Who should it come from?
|
||
|
if( $phone != "" || $email != "" ) {
|
||
|
error_log("SEND EMail ". $email. " ". $phone );
|
||
|
mail($to, $subject, $message, $headers);
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
if( isset($_REQUEST['phone']) ){
|
||
|
$phone = $_REQUEST['phone'];
|
||
|
|
||
|
////////////////
|
||
|
// DB Connect //
|
||
|
$db = new Zebra_Database();
|
||
|
$db->connect( SQLSERVER, SQLUSER, SQLPASSWORD, SQLDB );
|
||
|
$db->set_charset();
|
||
|
$db->debug=false;
|
||
|
|
||
|
$db->memcache_host = 'localhost';
|
||
|
$db->memcache_port = 11211;
|
||
|
$db->memcache_compressed = true;
|
||
|
$db->caching_method = 'memcache';
|
||
|
|
||
|
$db->query('
|
||
|
SELECT
|
||
|
phone, PIN, pubkey, pseudo, email, errors
|
||
|
FROM
|
||
|
user
|
||
|
WHERE
|
||
|
phone = ?
|
||
|
', array($phone));
|
||
|
|
||
|
$query_row = $db->fetch_assoc();
|
||
|
if( $db->returned_rows == 1 ) {
|
||
|
$pubkey = isset($query_row['pubkey'])?$query_row['pubkey']:'';
|
||
|
echo '{ "PubKey":"'.$pubkey.'" }';
|
||
|
//echo json_encode($query_row);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
*/
|
||
|
|
||
|
?>
|