Invoking a Program from HTML
9.8A
The PL/B Web Server allows a PLB program to be invoked using a HTTP POST request embedded in a HTML web page. This support is implemented to allow a PLB user to specify the PWS 'cmdline' and 'runopt' command line keywords without showing the data to the end user. This PWS logon method can be implemented using the HTML <form> element, the <input> element, and the submit button (i.e. <input type="submit">) or a JavaScript document submit instruction.
Example (1) using HTML web page without Javascript:
In this case, the following HTML page uses a HTTP POST request to logon to a PWS server where the submit operation is performed when the end-user clicks on the submit button. Also, the 'runopt' and 'cmdline' data are submitted in the HTTP POST request without being shown to the end-user on the browser URL.
<html>
<head></head>
<body>
<form action="http://127.0.0.1:8081/mb_post.plc" method="POST" >
<input type="text" name="runopt" value="-g100000" style="display: none">
<input type="text" name="cmdline" value="Edward;MyPassword;and More upto 250 bytes!!" style="display: none">
<input type="submit" value="Run 'mb_post.plc'">
</form>
</body>
</html>
Example (2) using HTML web page using Javascript:
In this case, the following HTML page uses a HTTP POST request to logon to a PWS server where the submit operation is performed using a JavaScript operation. Also, the 'runopt' and 'cmdline' data are submitted in the HTTP POST request without being shown to the end-user on the browser URL.
<html>
<head></head>
<body>
<form id="myPost" action="http://127.0.0.1:8081/mb_post.plc" method="POST" >
<input type="text" name="runopt" value="-g100000" style="display: none">
<input type="text" name="cmdline" value="Edward;MyPassword;and More upto 250 bytes!!" style="display: none">
</form>
<script>
document.getElementById("myPost").submit();
</script>
</body>
</html>
See Also: PL/B Web Server Command Line
![]() |