When the solution matters

Tips...

Registration Documentation Knowledgebase Seminars / Training Technical Support Partner Central

Hello World

In the previous example, 4D's web server sent a completely static HTML page to the web browser. In other words, what the web browser got was precisely the contents of the hello.html file. In the next step, 4D will send a semi-dynamic HTML page. A semi-dynamic HTML page is one that contains 4D Tags which will be replaced with data from 4D when the page is sent.

Return to your text editor, and create a new document. Cut and paste the following text into your document:

<html>
<head>
<title>4th Dimension Web Application</title>
<body>
<!--4DVAR WEB_t_Message-->
</body>
</html>

screenshot

Your document should now look someething like the picture above. You should save this file into the WebFolder and name it "hello2.html". You should note that this file contains a 4D tag: 4DVAR:

<!--4DVAR WEB_t_Message-->

When 4D sends the "hello2.html" file out to the web browser, it will replace <!--4DVAR WEB_t_Message--> with the contents of a 4D variable named WEB_t_Message.

screenshot

Return again to 4D's Design environment and modify the On Web Connection method. Replace the current contents of the method with the following:

C_TEXT(WEB_t_Message)

WEB_t_Message:="Hello, World!"

SEND HTML FILE("hello2.html")

screenshot

Back in your browser, you should see a page that looks exactly as the first step in this exercise did.

Previous Step  1 2 3 4 5 6 7 8  Next Step


International | Company | Contact 4D | Site Map | Privacy Policy | © 4D UK 1995-2008 | Change font size: [A] [A] [A] | Print this page