0
0

Updated author informations, updated location of included files, structured the website to the new layout, removed local fontawesome and moved to cloud CDN

This commit is contained in:
Bryan Pedini
2019-02-06 12:43:58 +01:00
parent b13167324a
commit d237a5443f
1608 changed files with 289 additions and 41171 deletions

32
lib/php/contactme.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
function check_email ( $email ) {
return filter_var ( $email, FILTER_VALIDATE_EMAIL );
}
function post_call ( $url, $data ) {
$options = [
'http' => [
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query ( $data )
]
];
$context = stream_context_create ( $options );
$result = file_get_contents ( $url, false, $context );
if ( $result === FALSE ) { /* Handle error */ } // TODO: next thing to do
}
if ( isset ( $_POST [ 'name' ] ) && isset ( $_POST [ 'email' ] ) && isset ( $_POST [ 'message' ] ) && check_email ( $_POST [ 'email' ] ) === false ) {
$message = [
'name' => $_POST [ 'name' ],
'email' => $_POST [ 'email' ],
'message' => $_POST [ 'email' ]
];
$message_json = json_encode ( $message );
post_call ( 'https://telegram.bryanpedini.it/bots/personal-website-contactform.php', $message_json );
/*
if you need anything specific about telegram bots or you want to request me a custom made telegram bot,
please contact me at info@telegram.bryanpedini.it
*/
}
?>