} return $ret; } $postdata = file_get_contents("php://input"); trigger_error('content: ' . $postdata, E_USER_NOTICE); $auth_login = getValFromTag($postdata, 'login'); $auth_password = getValFromTag($postdata, 'password'); $prop_key = getValFromTag($postdata, "property name='key' value"); $prop_version = getValFromTag($postdata, "property name='version' value"); $prop_screenwidth = getValFromTag($postdata, "property name='screen-width' value"); $prop_screenheight = getValFromTag($postdata, "property name='screen-height' value"); $prop_listoffset = getValFromTag($postdata, "<list offset"); $prop_listlimit = getValFromTag($postdata, " limit"); $prop_songid = getValFromTag($postdata, "<song id"); // pierdolona obsluga SDPe $prop_provider = getValFromTag($postdata, "property name='provider' value"); // obsługa Pulsara if ($prop_provider == null || strcmp("null", $prop_provider) == 0 || 0 == $prop_provider) { $prop_provider = "1"; } // 1 - Standard // $prop_provider= "2"; // 2 - Pulsar trigger_error('[SERVICE] provider: ' . $prop_provider . ", login:"******", password:"******"2") { $rowUser = $db->getProvider($prop_provider);
ob_start(); include "../scripts/myErrorHandler.php"; function getValFromTag($xml, $tag, $start) { $ret = NULL; $idx0 = strpos($xml, $tag, $start); if ($idx0 > 0) { $idxTagEnd = $idx0 + strlen($tag) + 2; $idx9 = strpos($xml, "'", $idxTagEnd); $ret = substr($xml, $idxTagEnd, $idx9 - $idxTagEnd); } return $ret; } $postdata = file_get_contents("php://input"); trigger_error('content: ' . $postdata, E_USER_NOTICE); $songId = getValFromTag($postdata, '<song id', 0); $sendXml = ""; $sendXml .= "<?xml version='1.0'?>\n"; $sendXml .= "<!DOCTYPE response SYSTEM 'http://mobikar.net/response.dtd'>\n"; $sendXml .= "<response>\n"; if ($songId != NULL) { $sendXml .= " <song id='0' name='Szla dzieweczka do laseczka' artist='piosenka ludowa'>\n"; $sendXml .= " <resource type='melody' addr='http://mobikar.net/get/0.midi'/>\n"; $sendXml .= " <resource type='lyric' addr='http://mobikar.net/get/0.mlyr'/>\n"; $sendXml .= " </list>\n"; } else { $sendXml .= " <list offset='0' limit='11'>\n"; $sendXml .= " <item id='0' name='Szla dzieweczka do laseczka - piosenka ludowa'/>\n"; $sendXml .= " </list>\n"; } $sendXml .= "</response>\n";