FoxWeb is an application framework that enables programmers to leverage the power of the Visual FoxPro programming language and database engine to create applications that run over the Internet. Its programming interface was designed to protect you from having to worry about the complexities of CGI programming, without taking away the control that is necessary in order to create powerful applications. If you have ever programmed a web application and dealt with the intricacies of CGI programming, you are already familiar with some of the functionality offered by FoxWeb's programming interface. If you haven't, you'll be pleasantly surprised at the simplicity of the programming involved.
FoxWeb uses a different paradigm than conventional VFP programs. Because of the nature of the World-Wide-Web, there is no way you could take an existing FoxPro application and just get it to run over the web. Web browsers receive information in a language called HTML (Hypertext Markup Language) and send information back to servers using HTML forms. Web applications must interface with Web browsers by reading the input of HTML forms, and formatting output content as HTML text. In order to convert an existing VFP application for Web use, you would have to re-write the user interface, including all code dealing with input and output. Other procedures handling the logic of the application, such as queries, data-updates, etc., can remain unchanged.
The FoxWeb programming interface provides functions that make it easy to read incoming data and dynamically create HTML output, which is sent back to the user's browser. In order to write FoxWeb programs it first necessary to obtain a general understanding of HTTP -- the protocol used to transfer Web content, such as text and images over the Internet. This topic also attempts to explain the differences between static and dynamic content.
The HTTP protocol is a request/response protocol. This means that a client, such as a web browser, sends a request to the web server in the form of an HTTP request message. This request contains, as part of its content, a request method, a Uniform Resource Identifier (URI), and protocol version followed by a MIME-like message. Uniform Resource Identifiers are simply formatted strings, which identify -- via name, location, or any other characteristic -- a resource - commonly known as a URL.
Once this message reaches the Web server, an attempt is made to satisfy the request. The server responds with a status line, including the message's protocol version and a success or error code and the requested resource. If there are embedded images or objects in the HTML response, the Web browser makes subsequent requests for each embedded object.
Depending to the resource requested in the URL, the server either reads a static file, such as an HTML page or GIF image from its hard-disk, or executes a server-side program, which creates dynamic content to be served back to the browser.
As a FoxWeb programmer you do not need to know much about HTTP. Although HTTP drives all content transportation over the Web, FoxWeb abstracts its details and provides a simplified programming interface that makes it easy to create Web-based applications. The main points that you need to remember from this discussion is that Web-applications, unlike other types of applications, do not maintain a continuous connection between the user interface component (in this case the browser) and the back-end application logic component (the Web application server). Information is exchanged in distinct interactions, which occur when the user clicks on a hyper-link or submits an HTML form.
FoxWeb in general terms works in a very simple manner: The user calls a FoxWeb script by clicking on a link, submitting an HTML form, or manually typing a URL in a Web browser. The URL contains information that indicates the script to be run as well as some optional arguments, which are passed on to the program along with any form fields. The request is received by the Web server, which passes it on to FoxWeb. FoxWeb parses the URL and other request information and runs the requested script. The information sent along with the request is made available to the script via FoxWeb's Request object. FoxWeb processes the requested script from top to bottom, executes any code included in it, and sends a Web page to the browser.
Because your scripts run on the server rather than on the client, your Web server does all the work involved in generating the HTML pages sent to browsers. Server-side scripts cannot be readily copied because only the result of the script is returned to the browser. Users cannot view the script commands that created the page they are viewing.