-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
41 lines (37 loc) · 1.01 KB
/
index.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
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
if (!empty($_POST)) {
$email = $_POST['email'];
$message = $_POST['message'];
echo $message;
include('class/db.php');
try {
$db = new Database();
$db->connect();
$db->insert('messages',array('email'=> $email, 'message'=> $message));
} catch (Exception $e) {
echo 'Exceção capturada: ', $e->getMessage(), "\n";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Meu Portfólio</title>
</head>
<body>
<h1>Esse é meu portfolio</h1>
<h2>Deixe uma mensagem</h2>
<form action="index.php" method="POST">
Seu email: <input type="text" name="email" /> <br />
Mensagem:
<textarea name="message"></textarea>
<input type="SUBMIT" />
</form>
</body>
</html>