-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnew_data.php
More file actions
105 lines (96 loc) · 3.66 KB
/
new_data.php
File metadata and controls
105 lines (96 loc) · 3.66 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php require "head.php" ?>
<?php require "get_ip.php" ?>
<?php require "db_connection.php" ?>
<?php
if (isset($_POST['send']))
{
if (!empty($_POST['ness_social_media']))
{
foreach ($_POST['ness_social_media'] as $selected)
{
}
}
else
{
$_POST['ness_social_media'] = "empty" ;
}
$ness_social = $_POST['ness_social_media'];
$timestamp = time();
$hostname = gethostbyaddr($ip);
$time = date('Y-m-d H:i:s');
try {
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password );
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = $conn->prepare("INSERT INTO questionnaire
(visit, frequency,rating,attractiveness,page_rating,
color,easy_to_find_info,ness_info,info_type,navigation,
need_update,need_update_text,subject,ness_social_media,optional_social_media,
sex,age,employee_type,ip,hostname,
date,date_normal)
VALUES (:visit, :frequency, :rating, :attractiveness, :rating,
:color, :easy_to_find_info, :ness_info, :info_type, :navigation,
:need_update,:need_update_text, :subject, :ns, :optional_social_media,
:sex, :age,:employee_type,:ip,:hostname,
:time,:timestamp)");
$visit = $_POST['visit'];
$frequency = $_POST['frequency'];
$rating = $_POST['rating'];
$attractiveness = $_POST['attractiveness'];
$rating = $_POST['rating'];
$color = $_POST['color'];
$easy_to_find_info = $_POST['easy_to_find_info'];
$ness_info = $_POST['ness_info'];
$info_type = $_POST['info_type'];
$navigation = $_POST['navigation'];
$need_update = $_POST['need_update'];
$need_update_text = $_POST['need_update_text'];
$subject = $_POST['subject'];
$ns = json_encode($ness_social,JSON_FORCE_OBJECT);;
$optional_social_media = $_POST['optional_social_media'];
$sex = $_POST['sex'];
$age = $_POST['age'];
$employee_type = $_POST['employee_type'];
$timestamp = time();
$hostname = gethostbyaddr($ip);
$time = date('Y-m-d H:i:s');
$sql->execute(array(
"visit" => $visit,
"frequency" => $frequency,
"rating" => $rating ,
"attractiveness" => $attractiveness ,
"rating" => $rating,
"color" => $color,
"easy_to_find_info" => $easy_to_find_info,
"ness_info" => $ness_info,
"info_type" => $info_type,
"navigation" => $navigation,
"need_update" => $need_update,
"need_update_text" => $need_update_text,
"subject" => $subject,
"ns" => $ns,
"optional_social_media" => $optional_social_media,
"sex" => $sex,
"age" => $age,
"employee_type" => $employee_type,
"ip" => $ip,
"hostname" => $hostname,
"time" => $time,
"timestamp" => $timestamp ));
?>
<?php require "messages.php"?>
<?php
}
catch(PDOException $e)
{
echo $sql . "<br>" . $e->getMessage();
}
$conn = null;
}
?>
<script type="text/javascript">
window.setTimeout(function(){
// Move to a new location or you can do something else
window.location.href = "http://system";
}, 3000);// czasprzejsćia na strone głowną
</script>