FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PHP-Code-Console/codeLoader.php at master · adamchenwei/PHP-Code-Console · GitHub
adamchenwei
/
PHP-Code-Console
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
3
Code
Issues
0
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
PHP-Code-Console
/
codeLoader.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
76 lines (63 loc) · 1.19 KB
Breadcrumbs
PHP-Code-Console
/
codeLoader.php
Copy path
File metadata and controls
76 lines (63 loc) · 1.19 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
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
<?php
/**
* @todo
* @version
* 1.0
*/
require_once
(
'
common.php
'
);
$
my_report_id
= -
1
;
require_once
(
'
incl-auth.php
'
);
if
( !
isset
(
$
auth_who
) ) {
echo
'
<h2>You need to be logged in to use this tool</h2>
'
;
exit
;
}
else
{
//echo $auth_who;
}
/*Load User Info*/
/*$log = new PHPConsoleLog;
$log->initials = $auth_employee->initials;
$log->ipnum = ip2long($_SERVER['REMOTE_ADDR']);
$log->hostname = $_SERVER['HTTP_HOST'];*/
//var_dump($log->initials);
/*Receive Data*/
$
data
=
file_get_contents
(
"
php://input
"
);
$
objData
=
json_decode
(
$
data
);
/*Get Data From DB*/
$
db
= db::
logs
();
$
sql
=
"
SELECT
myCodeId,
myCodeName,
myCodeOwner,
myCodeBody,
myCodeTimesUsedCount,
myCodeValueAsMins,
myCodeCreateDate,
myCodeLastEditDate,
isSnippet,
isDeleted,
isMyFavorite
FROM
php_console_history_beta_mycode
WHERE
myCodeOwner = '
$
objData
->
myCodeOwner
'
ORDER BY
myCodeLastEditDate DESC
LIMIT 1
"
;
$
res
=
$
db
->
query
(
$
sql
);
if
(!
$
res
){
/*echo ("res not found!");*/
}
else
{
/*echo ("res found!");*/
}
$
result
=
$
res
->
fetch_object
();
/*echo ($result);*/
$
objData
=
json_encode
(
$
result
);
/*echo ($objData);*/
if
(
$
objData
){
echo
$
objData
;
}
else
{
/*echo "Empty";*/
}
?>
Back
|
FazBrowse Home
|
New Git URL