-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathform_act.php
More file actions
17 lines (17 loc) · 1.01 KB
/
form_act.php
File metadata and controls
17 lines (17 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
include "conndb.php";
$user_name = trim(filter_input(INPUT_POST, 'fio', FILTER_SANITIZE_STRING));
$user_email = filter_var(trim(filter_input(INPUT_POST, 'user_e-mail', FILTER_SANITIZE_EMAIL)), FILTER_VALIDATE_EMAIL);
$user_comment = trim(filter_input(INPUT_POST, 'comment', FILTER_SANITIZE_SPECIAL_CHARS));
$user_cat = implode(",", $_POST['category']);
$suser_cat = filter_var(trim($suser_cat), FILTER_SANITIZE_STRING);
if(!empty($user_cat) && !empty($user_name) && !empty($user_email) && !empty($user_comment)) {
$sql = "insert into feedbacks(`categories`,`fio`,`email`,`comment`) values('{$user_cat}','{$user_name}','{$user_email}','{$user_comment}')";
}
if ($link->query($sql) === TRUE) {echo "Íîâûé îòçûâ äîáàâëåí <br/><br/>";}
else {echo "Îøèáêà: " . $sql . "<br>" . $link->error;}
$link->close();
$html='<html>
<link rel="icon" type="image/ico" href="feedback.ico" />
<input class="buttonSend" onclick="window.history.back();" title="Âåðíóòüñÿ íà ñòðàíèöó îòïðàâêè îòçûâà" type="button" value="Âåðíóòüñÿ"/>';
print $html;