-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
37 lines (24 loc) · 861 Bytes
/
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
// header("Access-Control-Allow-Origin: *");
// header('Content-Type: application/json');
// $servername = "localhost:3306";
// $username = "admin";
// $password = "hidden";
// $db = "note_db";
// $conn = mysqli_connect($servername, $username, $password, $db);
// if (!$conn) {
// die("Connection failed: " . mysqli_connect_error());
// }
// $id = filter_var($_GET['id'],FILTER_SANITIZE_NUMBER_INT);
// $title = filter_var($_GET['title'], FILTER_SANITIZE_STRING);
// $author = filter_var($_GET['author'], FILTER_SANITIZE_STRING);
// $message = filter_var($_POST['message'], FILTER_SANITIZE_STRING);
// $errors = [];
// if ($title == "") {
// array_push($errors, "title is empty");
// }
// if ($author == "") {
// array_push($errors, "author is empty");
// }
// if ($message == "") {
// array_push($errors, "message is empty");
// }