KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Process Customer login using HTTP Post
PRODUCT: 4D Business Kit | VERSION: 2.x | PLATFORM: Mac & Win
Published On: September 25, 2003
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

Starting from 4D Business Kit version 2.x , you will now be able to post information from one page to another that is served by the 4DBK Server without the use of Javascript! One example where this may be beneficial is during the customer login process. The command that will allow you to do this, is the 4DBKHttpPostProcess command.

With this command, the values you assign in an input field will get posted to the page specified in the 4DBKHttpPostProcess command. Once the 4DBK Server returns this page, you can call the values entered into the input fields by using the 4DBKHttpPostParms command. The 4DBKHttpPostParms command accepts the name of the input value on the previous page. For example,

On our identification.html page, we have this form statement:

<form name="IdentForm" enctype="application/x-www-form-urlencoded" method="post" action="https://127.0.0.1/4daction/4DBKHttpPostProcess/login.html">
<p>Login: <input type="text" value="" name="CusCode" size="35"></p>
<p>Password: <input type="password" value="" name="CusPassword" size="15"></p>
<p><input type="submit" name="Submit" value="Submit"></p>

Once the values are entered for the two input fields (CusCode and CusPassword), and the submit button has been clicked, this information are posted to the 4DBK Server and the page login.html is served. In the login.html page, we can retrieve the values posted by calling 4DBKHttpPostParms/CusCode and 4DBKHttpPostParms/CusPassword to get the respective values.

Our login.html page:

<!--#4DBKCustomerLogin/4DBKHttpPostParms/CusCode,4DBKHttpPostParms/CusPassword-->
<!--#4DBKIf ("4DBKField/ErrorCode"#"")-->
<!--#4DBKGo/error.html-->
<!--#4DBKElse-->
<!--#4DBKGo/success.html-->
<!--#4DBKEndIf-->

The posted values are retrieved and passed into the 4DBKCustomerLogin command. When this page loads, 4DBK will execute these commands, and you will be redirected immediately, depending on the result of the error code of course.