From cbcc2d9217409046ca6b23ad6b0ea329870a851e Mon Sep 17 00:00:00 2001 From: Naumann Date: Thu, 11 Jun 2020 11:48:57 +0200 Subject: [PATCH] it works! (findKatalog) --- add.php | 61 +++++++++++++++++++++++++++++ addKatalog.php | 42 ++++++++++++++++++-- findKatalog.htm | 76 ------------------------------------ findKatalog.php | 102 ++++++++++++++++++++++++++++++++++++++++++++++++ index.html | 4 +- 5 files changed, 204 insertions(+), 81 deletions(-) create mode 100644 add.php delete mode 100644 findKatalog.htm create mode 100644 findKatalog.php diff --git a/add.php b/add.php new file mode 100644 index 0000000..e00e3a0 --- /dev/null +++ b/add.php @@ -0,0 +1,61 @@ + + + + Test Link + + + +
+ +
+ + + \ No newline at end of file diff --git a/addKatalog.php b/addKatalog.php index 12026bf..b54324a 100644 --- a/addKatalog.php +++ b/addKatalog.php @@ -14,7 +14,7 @@ ?> +$_POST["Title"], + "Author"=>$_POST["Author"], + "Country"=>$_POST["Country"], + "Link"=>$_POST["Link"], + "Language"=>$_POST["Language"], + "Pages"=>$_POST["Pages"], + "Year"=>$_POST["Year"], + "LendTime"=>$_POST["LendTime"], + "Category"=>$_POST["Category"], + "ImageLink"=>$_POST["ImageLink"], + "LendType"=>$_POST["LendType"]); + $json = json_encode($form); + $data = $form; + + // use key 'http' even if you send the request to https://... + $options = array( + 'http' => array( + 'header' => "Content-type: application/json\r\n", + 'method' => 'POST', + 'content' => http_build_query($data), + ), + ); + $context = stream_context_create($options); + //echo $context; + $result = file_get_contents('http://localhost:5000/api/katalog/'); + echo $result; + } + +?> + @@ -96,7 +132,7 @@ - diff --git a/findKatalog.htm b/findKatalog.htm deleted file mode 100644 index ee71cf2..0000000 --- a/findKatalog.htm +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - Katalog - - - -
- -

Katalog

-
-
-

Eingabe

-
- - -
-
- -
-

Ausgabe

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ProductId
Titel
Autor
Erscheinungsland
Link
Sprache
Seitenzahl
Erscheinungsjahr
Kategorie
Bildlink
Verleihdauer
Verleihart
-
- - \ No newline at end of file diff --git a/findKatalog.php b/findKatalog.php new file mode 100644 index 0000000..f736ee9 --- /dev/null +++ b/findKatalog.php @@ -0,0 +1,102 @@ + array( + 'header' => "Content-type: application/json\r\n", + 'method' => 'POST' + ), + ); + $context = stream_context_create($options); + //echo $context; + $id= $_POST["ProductId"]; + $result = file_get_contents('http://localhost:5000/api/katalog/'.$id); + //echo $result; + $json= json_decode($result, true); + + } + +?> + + + + + + + + Katalog + + + +
+ +

Katalog

+
+
+

Eingabe

+
+ + +
+
+ +
+

Ausgabe

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ProductId
Titel
Autor
Erscheinungsland
Link
Sprache
Seitenzahl
Erscheinungsjahr
Kategorie
Bildlink
Verleihdauer
Verleihart
+
+ + \ No newline at end of file diff --git a/index.html b/index.html index 297db3d..382c187 100644 --- a/index.html +++ b/index.html @@ -19,8 +19,8 @@