Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MediaDBViewerAPI
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BA_SI-Projekt
MediaDBViewerAPI
Commits
e336fdb1
Commit
e336fdb1
authored
Jan 20, 2016
by
Nico Schallehn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
POST test und Fertig programmieren
parent
7ecd632a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
12 deletions
+29
-12
POST_test.php
POST_test.php
+2
-8
api.class.php
api.class.php
+27
-4
No files found.
POST_test.php
View file @
e336fdb1
...
@@ -22,15 +22,9 @@ function PostToHost($host, $path, $referer, $data_to_send) {
...
@@ -22,15 +22,9 @@ function PostToHost($host, $path, $referer, $data_to_send) {
return
$res
;
return
$res
;
}
}
$data
=
"imdbID=0398286"
;
printf
(
"Go!
\n
"
);
printf
(
"Go!
\n
"
);
$x
=
PostToHost
(
echo
PostToHost
(
"mediadb.ivaya.de"
,
"/api.php?key=SCHLUESSEA&action=SetData&Tabelle=Filme"
,
"http://mediadb.ivaya.de/"
,
"imdbID=0398286&3d=&Gesehen=ja"
)
.
PHP_EOL
.
PHP_EOL
;
"mediadb.ivaya.de"
,
echo
PostToHost
(
"mediadb.ivaya.de"
,
"/api.php?key=SCHLUESSEA&action=SetData&Tabelle=Filme"
,
"http://mediadb.ivaya.de/"
,
"imdbID=0398286&3d=&checked=0&comment=Bildfehler"
)
.
PHP_EOL
.
PHP_EOL
;
"/api.php?key=SCHLUESSEA&action=SetData&Tabelle=Filme"
,
"http://mediadb.ivaya.de/"
,
$data
);
echo
$x
;
//http://mediadb.ivaya.de/api.php?key=0123456789&action=GetDataList&Tabelle=Serien&Spalten=Statistik
//http://mediadb.ivaya.de/api.php?key=0123456789&action=GetDataList&Tabelle=Serien&Spalten=Statistik
\ No newline at end of file
api.class.php
View file @
e336fdb1
...
@@ -295,12 +295,35 @@ class MediaDBViewerAPI{
...
@@ -295,12 +295,35 @@ class MediaDBViewerAPI{
if
(
(
$this
->
API_Rechte
>=
3
)){
if
(
(
$this
->
API_Rechte
>=
3
)){
if
(
isset
(
$GET_arr
[
"Tabelle"
])){
if
(
isset
(
$GET_arr
[
"Tabelle"
])){
if
(
$GET_arr
[
"Tabelle"
]
==
"Filme"
){
if
(
$GET_arr
[
"Tabelle"
]
==
"Filme"
){
if
(
isset
(
$POST_arr
[
"imdbID"
])){
if
(
isset
(
$POST_arr
[
"imdbID"
])
AND
isset
(
$POST_arr
[
"3d"
])
){
$Query
=
"UPDATE "
.
$GET_arr
[
"Tabelle"
]
.
" WHERE imdbID = "
.
$POST_arr
[
"imdbID"
];
//UPDATE ".$GET_arr["Tabelle"]." WHERE imdbID = ".$POST_arr["imdbID"];
return
$this
->
error
(
1001
,
"Auszuführender Query: "
.
$Query
);
$Set
=
"SET "
;
$first
=
true
;
// = Filter:
if
(
isset
(
$POST_arr
[
"Gesehen"
])){
//AND is_numeric($GET_arr[$key])
$Set
.=
(
$first
?
""
:
" , "
)
.
"views = views+1"
;
$first
=
false
;
}
if
(
isset
(
$POST_arr
[
"checked"
])){
//AND is_numeric($GET_arr[$key])
$Set
.=
(
$first
?
""
:
" , "
)
.
"checked = '"
.
$POST_arr
[
"checked"
]
.
"'"
;
$first
=
false
;
}
if
(
isset
(
$POST_arr
[
"comment"
])){
//AND is_numeric($GET_arr[$key])
$Set
.=
(
$first
?
""
:
" , "
)
.
"comment = '"
.
$POST_arr
[
"comment"
]
.
"'"
;
$first
=
false
;
}
if
(
$first
){
// Fehler...
return
$this
->
error
(
1004
,
"Mindestens einer der folgenden Paramter war erwartet = Gesehen, checked, comment!"
);
}
else
{
$Query
=
"UPDATE Filme "
.
$Set
.
" WHERE imdbID = '"
.
$POST_arr
[
"imdbID"
]
.
"' AND `3d` = "
.
$POST_arr
[
"3d"
]
.
";"
;
return
$this
->
error
(
1001
,
"Auszuführender Query: "
.
$Query
);
}
}
}
else
{
else
{
return
$this
->
error
(
1004
,
"Erwartet war imdbID!"
);
return
$this
->
error
(
1004
,
"Erwartet war imdbID
und 3d
!"
);
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment