Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <HTML>
- <HEAD>
- <META HTTP-EQUIV="content-type" content="text/html; charset=utf8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- </HEAD>
- <BODY>
- <?php
- if (isset($_POST['remote'])) {
- if (isset($_POST['z_reki']) && $_POST['z_reki']) {
- $remote = $_POST['wys_remote'];
- } else {
- $remote = $_POST['remote'];
- }
- $xml_post_string = '<?xml version="1.0" encoding="utf-8"?>
- <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
- <s:Body>
- <u:ProcessInputEvent xmlns:u="urn:adbglobal.com:service:X_ADB_RemoteControl:1"><InputEvent>ev=keydn,code=' . $remote . '</InputEvent></u:ProcessInputEvent></s:Body>
- </s:Envelope>'; // data from the form, e.g. some ID number
- $headers = array("HTTP/1.1",
- "Content-Length: " . strlen($xml_post_string) + 1,
- "Content-Type: text/xml;charset=\"utf-8\"",
- "HOST: 192.168.1.8:8080",
- "SOAPAction: \"urn:adbglobal.com:service:X_ADB_RemoteControl:1#ProcessInputEvent\"",
- "User-Agent: SAMSUNG-SGH-I317/internal UPnP/1.0 BH-upnpcp/2.0 DLNADOC/1.50",
- ); //SOAPAction: your op URL
- $url = "http://192.168.1.8:8080/upnpfun/ctrl/uuid_2a11ec20-1dd2-11b2-bf84-0003919f1eb6/04";
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string); // the SOAP request
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- $response = curl_exec($ch);
- curl_close($ch);
- // echo '<xmp>' . $response . '</xmp>';
- $xml_post_string = '<?xml version="1.0" encoding="utf-8"?>
- <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
- <s:Body>
- <u:ProcessInputEvent xmlns:u="urn:adbglobal.com:service:X_ADB_RemoteControl:1"><InputEvent>ev=keyup,code=' . $remote . '</InputEvent></u:ProcessInputEvent></s:Body>
- </s:Envelope>';
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string); // the SOAP request
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- $response = curl_exec($ch);
- curl_close($ch);
- // echo '<xmp>' . $response . '</xmp>';
- }
- $klawisze = [
- 116 => "POWER"
- , 174 => "HOME"
- , 361 => "VOD"
- , 365 => "EPG"
- , 367 => "APP"
- , 395 => "LIST"
- , 114 => "VOL-"
- , 113 => "MUTE"
- , 115 => "VOL+"
- , 103 => "UP"
- , 108 => "DOWN"
- , 105 => "LEFT"
- , 352 => "OK"
- , 106 => "RIGHT"
- , 357 => "OPT"
- , 358 => "INFO"
- , 402 => "PROG+"
- , 403 => "PROG-"
- , 158 => "BACK"
- , 385 => "RADIO"
- , 102 => "PORTAL"
- , 388 => "TEXT"
- , 398 => "RED"
- , 399 => "GREEN"
- , 400 => "YELLOW"
- , 401 => "BLUE"
- , 128 => "STOP"
- , 207 => "PLAY"
- , 119 => "PAUSE"
- , 167 => "REC"
- , 168 => "<<"
- , 159 => ">>"
- , 2 => "[1]"
- , 3 => "[2]"
- , 4 => "[3]"
- , 5 => "[4]"
- , 6 => "[5]"
- , 7 => "[6]"
- , 8 => "[7]"
- , 9 => "[8]"
- , 10 => "[9]"
- , 11 => "[0]"];
- echo '<center><form enctype="multipart/form-data" action="postuj.php" method="POST">
- <table border="0" width="30%" cellspacing="0" cellpadding="1">
- <input type="hidden" name="remote" Id="remote" value="1">
- <input type="hidden" name="z_reki" Id="z_reki" value="">';
- $licznik = 0;
- echo '<tr>';
- foreach ($klawisze as $kod => $nazwa) {
- $licznik++;
- echo '<td><input type="button" value="' . $nazwa . '" onclick="{document.getElementById(\'remote\').value=' . $kod . ';this.form.submit();}"></td>';
- if ($licznik == 3) {
- echo '</tr><tr>';
- $licznik = 0;
- }
- }
- if ($licznik < 3 && $licznik > 0) {
- echo '</tr>';
- }
- echo '</table>
- Kod : <input type="text" name="wys_remote" ';
- if (isset($_POST['remote'])) {
- $remote = (int) $_POST['wys_remote'];
- echo 'value = "' . $remote . '"';
- }
- echo '><input type="button" name="wysylamy" value="Wyślij" onclick="{document.getElementById(\'z_reki\').value=1;this.form.submit();}"></form></center>';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement