From 261a7ac22a6027e024aa12efb35cbeaac67fad59 Mon Sep 17 00:00:00 2001 From: Maksymilian Jopek Date: Sun, 26 Mar 2023 20:32:38 +0200 Subject: Add start script --- index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'index.php') diff --git a/index.php b/index.php index ee7431c..cb50f69 100644 --- a/index.php +++ b/index.php @@ -7,12 +7,13 @@ if ($method === "GET") { $result = $xml->xpath('//NAZWA_DOD[text()="województwo"]/ancestor::*/NAZWA/text()'); } else if ($method === "POST") { $body = file_get_contents('php://input'); - $one_xpath = true; + $one_xpath = false; if (!$one_xpath) { $id = $xml->xpath('//row/NAZWA[text()="' . $body . '"]/ancestor::*/WOJ'); $id = "{$id[0]}"; $result = $xml->xpath('//WOJ[text()=' . $id . ']/ancestor::*/NAZWA_DOD[contains(text(),"miejs")]/ancestor::*/NAZWA/text()'); } else { + set_time_limit(200); $result = $xml->xpath('//WOJ[text()=//row/NAZWA[text()="' . $body . '"]/ancestor::*/WOJ]/ancestor::*/NAZWA_DOD[contains(text(),"miejs")]/ancestor::*/NAZWA/text()'); } } -- cgit v1.3.1