I have below code that works but it is slow is there any suggestion to improve turnaround.
How can I have it accept only numbers from 1 to 10 and reject alpha
"h**p://mydomai.any/handler.php?msg1=10" ok
"h**p://mydomai.any/handler.php?msg1=14" not ok
"h**p://mydomai.any/handler.php?msg1=HELLO" no ok (now it accepts all)
handler.php
<?php
header("HTTP/1.1 200 OK");
if (isset($_REQUEST['msg1'])) {
$msg1 = $_REQUEST['msg1'];
?>
<script type="text/javascript" src="https://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="http://signage.me/demo/sendCommand.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
sendCommand("galaxy.signage.me", "username", "password", "13", "new1", (msg1 = <?php echo (json_encode($msg1)); ?>));
});
</script>
<?php
}
?>