PicLan-IP processes inbound data with helper functions that are included in the active MV/Basic code that is included on the HTML page that the data is posted to. These functions allow your MV/Basic code to "read" the value of named form controls with a MV/Basic statement that looks like:
This statement looks like a Pick read statement, but is actually an extension to MV/Basic that the PicLan-IP web server supports. It is time to look at an example. This is an example of an HTML form:PL_GETVAR val FROM name ELSE ...
The actual HTML source that is involved in creating this input filed is:
This example create a single input field with name=NAME and with an initial value=George. If the user submits this form, the web server can retrieve the value George that is associated with the input field named NAME. With PicLan-IP you would retrieve this form variable's value with the statement:Name: <input type=text size=30 maxlength=256 name="NAME" value="George">
PL_GETVAR NAME FROM "NAME" ELSE NAME = ""
This illustrates how PicLan-IP insertion points can be included anywhere within the HTML text, including embedded within HTML tags.Name: <input type=text size=30 maxlength=256 name="NAME" value="{NAME}">
One last type of form field is the hidden input field. A hidden input field acts just like a text box except that it is not displayed. At first though, you may wonder why you would want a non-displaying input field. The answer is that this provides a mechanism whereby the web server can save information as a part of a form that will be returned the next time the form is transmitted back to the web server. Remember that the HTTP protocol is stateless. This means that the web server gets discrete events and has no real concept of a session with any particular user. Hidden input fields allow the web server to same information about a user, such as their account number, password, previous pages accessed (along with data), and similar as a part of the form. This way, the HTML form itself stores the "state" information about the user.
In this manner, GET allows you to pass data to the web server as a part of the resource name. POST supplies exactly the same data to the web server in exactly the same format, except that instead of being a part of the command line, the data is hidden in the HTTP header (which is not displayed but is available to the PicLan-IP web server).http://modsoft.com/db.htm?ID=0001
Whether you should use GET or POST is up to you. There are some issues that you should consider. GET allows the user to "see" what is going on. In some cases, this is not a bad thing. In other cases, you may wish to hide your programs logic. GET also allows a page, along with supplied data, to be "bookmarked" (added to the browsers bookmark file). If you do not wish to let the user arbitrarily run a function, using POST makes this more difficult. An finally, there is a limit to the number of characters that browsers and web server support with GET (PicLan-IP does not actually have a hard limit here, but most web servers and all web browsers do). So if you are passing a large amount of data or if the data should be kept private, use POST instead of GET.
{INCLUDE _WEB_FTR.HTM}