-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact.php
41 lines (32 loc) · 1.28 KB
/
contact.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
if (isset($_POST['email']) && isset($_POST['message'])) {
$chatId = '';
$token = '';
$text = urlencode($_POST['email'] . "\n" . $_POST['message']);
file_get_contents("https://api.telegram.org/bot{$token}/sendMessage?chat_id={$chatId}&parse_mode=html&text={$text}");
$message = 'Спасибо за ваше сообщение';
}
?>
<!DOCTYPE html>
<html lang="en">
<?php include 'includes/head.php' ?>
<body>
<?php include 'includes/header.php'; ?>
<div class="container">
<?php include 'includes/message.php' ?>
<form method="POST">
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" name="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
</div>
<div class="form-group">
<label for="exampleInputMessage1">Your message</label>
<textarea type="text" name="message" class="form-control" id="exampleInputMessage1"></textarea>
</div>
<button type="submit" class="btn btn-primary">Отправить</button>
</form>
</div>
<?php include 'includes/footer.php'; ?>
</body>
</html>