Tutorials to .com

Tutorials to .com » Software » Vfp » FoxWeb line with the rapid release of your database FOXPRO

FoxWeb line with the rapid release of your database FOXPRO

Print View , by: iSee ,Total views: 37 ,Word Count: 1827 ,Date: Sun, 19 Apr 2009 Time: 12:09 AM


Author:first

FoxWeb Microsoft foxpro series issued specifically for the development of a database and CGI interface, if you are familiar with Foxpro programming, you need to do is find out how to use FoxWeb can quickly develop a satisfactory site (or maybe you just know after reading this article how to do it)! Of course, you must have a certain degree of HTML based on!
Here's how to use procedures FoxWeb to develop WEB!
1, the system first of all, the installation configuration, you can download the installation files from the www.FoxWeb.com, free trial version for 30 days. Before installation, you must install more than VFP3.0 version, then install FoxWeb, installation is very simple, the installation is complete, restart FoxWebControlCenter, you need to do is simple to configure some basic parameters can be a!

Admin.Name: the administrator's name. CGI.AdminName it will be saved in the.
Admin.E-Mail: administrator EMAIL. It will be stored in CGI.Admin in.
PRGTimeout: timeout, which instructions to return a server error in the results to the user to wait for user program before the end of time (seconds).
VFP.EXE: VFP.EXE the absolute path.
ProgramRoot: procedures for the root directory of the user's absolute path. Procedures should be placed in your directory in this phase.
TotalChannels: the total number of FoxWeb Channel. It consists of server memory and CPU to determine the number, in a single CPU server, preferably not more than four.
Other parameters according to the default value you can be a!
2, how to extract the client information.
Client information includes two parts: HTTP data and form data items. HTTP data include client and server-side information, such as client IP, server name, etc., they are on the CGI object, you can apply as long as CGI.NameOfParameter with the corresponding values, such as CGI.RemoteAddress will return the client IP Address!
Form data items include information entered by the user, it is necessary to remove these values, using function FormField () can, for example, FormField ( "LastName") will return to the form input box named LastName value.
3, how to generate and return the results to the user.
To withdraw from the program in your future, FoxWeb will look for common variables html_out, and its contents back to the browser, so you need to do is to return the results you want to write can be a variable html_out! Back to results back to the first line must be the result of the MIME type, and follow-up to a blank line. For example, the usual HTML output, to go back to the results of the first line of writing: Content-type: text / html
FoxWeb provide a very convenient way to generate returns results, you can generate the results you want to format generated by the template, and save documents in the database or the procedures, the President into a template of the value of all the variables, and then FoxWeb function provided by MergeTxt () will be able to generate results, and the function will be automatically put in the template variable ("<<" and ">>" between the contents of) the actual replacement value of the variable.
4, URL structure.
URL call FoxWeb process is structured as follows:
http://ServerName/cgi-shl/FoxWeb.exe/ProgramName?QueryString
Which, ServerName is your name WEB server, Cgi-shl is your CGI directory, ProgramName is your program name (without. Prg suffix), can be a relative path, it can be an absolute path. ProgramName another format is "Procedure @ Program", which corresponds to FoxPro's "DOprocedureINprogram" command. QueryString is CGI.QueryString you want to put the values in variables. Such as:
"http://myserver.com/cgi-shl/FoxWeb.exe/list @ c: \ prg \ customer? all"
Will be called "DOlistINc: \ prg \ customer", which is run prg file "C: \ PRG \ CUSTOMER" in the process of "LIST", CGI.QueryString value will be set to the string "all".
5, the overall process.
The course of two FoxWeb Board, FW_ENTER.PRG and FW_EXIT.PRG, they must be placed on the root directory of the procedure (ProgramRoot) in. They each have been FoxWeb the implementation of the request, FW_ENTER.PRG procedures for the implementation of the user before the execution, if it's the return of results. F., the user will not be the implementation of procedures. FW_EXIT.PRG implementation in the user program after the implementation of the overall process, therefore the two to set up the system environment in general or for the safety of access control.
The following is a simple example, it simply extract the value entered by the user, and return the value to the user:
Including a home page a.html form is as follows:
<Html>
<Head>
<Title> test </ title>
</ Head>
<Body>
<Form action = "/ cgi-bin/FoxWeb.exe/test" method = "POST"> Please enter your name:
<Input type = "text" name = "name">
<Input type = "Submit" name = "ok" value = "OK">
</ Form>
</ Body>
</ Html>
Test.prg user program are as follows:
M. Name = alltrim (formField ( 'name'))&& out the value of user input
html_out = MergeTxt (ReadFile ( "moban.txt "))&& back to return the results to the user
Moban.txt template file is as follows:
Content-type: text / html
<HTML>
<HEAD>
<TITLE> enter the results </ TITLE>
</ HEAD>
<BODY>
Your name is: <<m.name>>
Your IP is: <<cgi.remoteaddress>>
</ BODY>
</ HTML>
If the user enters the name of Bruce Lee, the user will receive the following page:
<HTML>
<HEAD>
<TITLE> enter the results </ TITLE>
</ HEAD>
<BODY>
Your name is: Bruce Lee, your IP is: 202.103.111.85
</ BODY>
</ HTML>
Introduced through the above-mentioned, you should use FoxWeb to have a general understanding, but to really use it to develop powerful applications, this is not enough. For more detailed information, please refer to www.FoxWeb.com. Which include the function reference, file upload, debug, and optimize the performance and procedures for more detailed safety information.

(End)


Visual FoxPro Tutorial Articles


Can't Find What You're Looking For?


Rating: Not yet rated

Comments

No comments posted.