FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pmfstat_server/getstatdata.php at master · pmfstat/pmfstat_server · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
pmfstat
/
pmfstat_server
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pmfstat_server
/
getstatdata.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
50 lines (40 loc) · 1.39 KB
Breadcrumbs
pmfstat_server
/
getstatdata.php
Copy path
File metadata and controls
50 lines (40 loc) · 1.39 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
<?php
require_once
(
'
../inc/sql.php
'
);
require_once
(
'
../inc/init.php
'
);
try
{
$
pdo
=
new
PDO
(
'
mysql:host=
'
.
$
db_server
.
'
;dbname=
'
.
$
db_name
,
$
db_user
,
$
db_pw
);
}
catch
(
Exception
$
e
) {
die
(
"
Internal server error while processing statistic data: Couldn't connect to database
"
);
}
PMF_Init::
cleanRequest
();
$
dat
=
unserialize
(@
$
_POST
[
'
systemdata
'
]);
if
(!
is_array
(
$
dat
)) {
die
(
"
Internal server error while processing statistic data: Bad input!
"
);
}
$
dat
[
'
q
'
] = @
$
_POST
[
'
q
'
];
// special tratment for extension list:
$
dat
[
'
PHP
'
][
'
extensions
'
] = @
implode
(
$
dat
[
'
PHP
'
][
'
extensions
'
],
'
|
'
);
$
dat
[
'
q
'
][
'
other
'
] = (
string
)@
implode
(
$
dat
[
'
q
'
][
'
other
'
],
'
|
'
);
$
fields
=
array
();
$
values
=
array
();
foreach
(
$
pdo
->
query
(
"
SHOW COLUMNS FROM stat
"
)
as
$
row
)
{
if
(
$
row
[
'
Field
'
] ==
'
id
'
||
$
row
[
'
Field
'
] ==
'
report_date
'
) {
continue
;
}
list
(
$
prefix
,
$
field
) =
explode
(
'
_
'
,
$
row
[
'
Field
'
],
2
);
if
(
isset
(
$
dat
[
$
prefix
][
$
field
]) && !
is_null
(
$
dat
[
$
prefix
][
$
field
])) {
$
fields
[] =
'
`
'
.
$
row
[
'
Field
'
].
'
`
'
;
$
values
[] = @
$
dat
[
$
prefix
][
$
field
];
}
}
$
sql
=
sprintf
(
"
INSERT INTO %s (%s) VALUES (%s)
"
,
'
stat
'
,
implode
(
'
,
'
,
$
fields
),
implode
(
'
,
'
,
array_fill
(
0
,
sizeof
(
$
fields
),
'
?
'
)));
$
stmt
=
$
pdo
->
prepare
(
$
sql
);
foreach
(
$
values
as
$
key
=>
$
value
) {
$
stmt
->
bindValue
(
$
key
+
1
,
$
value
);
}
$
stmt
->
execute
();
echo
'
<p>Thank you for yur support! Have fun with your FAQ!</p>
'
;
Back
|
FazBrowse Home
|
New Git URL