dojox/rpc/tests/resources/jsonpEcho.phps
raw| 1 | <?php |
| 2 | // ensure that we don't try to send "html" down to the client |
| 3 | header("Content-Type: application/json"); |
| 4 | |
| 5 | $jsonp = false; |
| 6 | $result = ""; |
| 7 | |
| 8 | if ($_REQUEST["testCallbackParam"]){ |
| 9 | $jsonp=true; |
| 10 | $result .= $_REQUEST['testCallbackParam'] . "('"; |
| 11 | } |
| 12 | |
| 13 | if (!$_REQUEST["message"]){ |
| 14 | $result .= "ERROR: message property not found"; |
| 15 | } |
| 16 | |
| 17 | $result .= $_REQUEST["message"]; |
| 18 | |
| 19 | if ($jsonp) { |
| 20 | $result .= "');"; |
| 21 | } |
| 22 | |
| 23 | print $result; |
| 24 | |
| 25 | |
| 26 | ?> |