<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://panoptic.com/mediawiki/aolserver/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bootiack</id>
	<title>AOLserver Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://panoptic.com/mediawiki/aolserver/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bootiack"/>
	<link rel="alternate" type="text/html" href="https://panoptic.com/wiki/aolserver/Special:Contributions/Bootiack"/>
	<updated>2026-04-25T16:26:14Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=ADP&amp;diff=5175</id>
		<title>ADP</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=ADP&amp;diff=5175"/>
		<updated>2008-11-20T00:21:00Z</updated>

		<summary type="html">&lt;p&gt;Bootiack: removed extra square bracket around ns_httptime&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Acronym: AOLserver Dynamic Pages&lt;br /&gt;
&lt;br /&gt;
ADP is the primary method of providing dynamic content on AOLserver.&lt;br /&gt;
&lt;br /&gt;
ADPs contain a mixture of '''TCL''' and HTML, with the TCL code being parsed and evaluated by AOLserver as it delivers the page.  ADPs may invoke other ADPs (using [[ns_adp_include]]) and thereby build up libraries for common elements and subsections of a page like title headers,  menu and navigation bars, and footers, as well functional modules like acess validation or database queries.&lt;br /&gt;
&lt;br /&gt;
The TCL code in an ADP is contained within '''&amp;lt;% %&amp;gt;''' pseduo-tag pairs.  A modified format, '''&amp;lt;%= %&amp;gt;''', displays the results of the TCL code.  A very simple ADP would be:&lt;br /&gt;
   &amp;lt;html&amp;gt;&lt;br /&gt;
      &amp;lt;head&amp;gt;&lt;br /&gt;
         &amp;lt;title&amp;gt;My Clock&amp;lt;/title&amp;gt;&lt;br /&gt;
      &amp;lt;/head&amp;gt;&lt;br /&gt;
   &amp;lt;body&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   &amp;lt;p&amp;gt;&lt;br /&gt;
   The time is now&lt;br /&gt;
   &amp;lt;%= [ns_httptime [ns_time]] %&amp;gt;.&lt;br /&gt;
   &amp;lt;/p&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
   &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a little bit more detail, and to take your first step on a long and winding road, see [[Writing Your First ADP]].&lt;/div&gt;</summary>
		<author><name>Bootiack</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Writing_Your_First_ADP&amp;diff=5174</id>
		<title>Writing Your First ADP</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Writing_Your_First_ADP&amp;diff=5174"/>
		<updated>2008-11-20T00:18:38Z</updated>

		<summary type="html">&lt;p&gt;Bootiack: the ns_httptime had an extra [ on each side, removed, works in my aolserver now&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ADPs are the simplest way to create a dynamic page in AOLserver. They support the use of all Tcl commands - including AOLserver ones and those you create in Tcl libraries - mixed with HTML to create a complete web page. Unlike Tcl libraries, any changes you make to the ADP take effect immediately without having to restart the server.&lt;br /&gt;
&lt;br /&gt;
'''Configuration'''&lt;br /&gt;
&lt;br /&gt;
Before you start trying, make sure you have configured AOLserver correctly to parse ADP pages.&lt;br /&gt;
&lt;br /&gt;
In the configuration file (usually nsd.tcl), make sure that below:&lt;br /&gt;
&lt;br /&gt;
 ns_section &amp;quot;ns/server/${servername}/adp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
but before the next &amp;quot;ns_section&amp;quot;, you have the line: &lt;br /&gt;
&lt;br /&gt;
 ns_param map &amp;quot;/*.adp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
uncommented.&lt;br /&gt;
&lt;br /&gt;
When you start AOLserver, do so by using the &amp;quot;-ft&amp;quot; option; this runs the server in the foreground and shows any Tcl errors on the console.&lt;br /&gt;
&lt;br /&gt;
If you are running AOLserver in the more usual background mode, errors in ADP pages are written to the server log, by default SERVERHOME/log/server.log, or locate it from the value (path and filename) returned by [[ns_info log]].&lt;br /&gt;
&lt;br /&gt;
'''Writing an ADP'''&lt;br /&gt;
&lt;br /&gt;
In the server's pageroot, create a file called ''test.adp'' using your favourite editor and enter the following code:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%&lt;br /&gt;
    set title &amp;quot;Hello, AOLserver!&amp;quot;&lt;br /&gt;
    ns_adp_puts $title&lt;br /&gt;
 %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now request that page in a web browser.&lt;br /&gt;
&lt;br /&gt;
Another way to display the value of &amp;quot;title&amp;quot; would be:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%= $title %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using that syntax, you can also display the results of a Tcl command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%= [ns_httptime [ns_time]] %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Mixing HTML and Tcl'''&lt;br /&gt;
&lt;br /&gt;
You can mix HTML and Tcl code to make a complete page:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%&lt;br /&gt;
    set title &amp;quot;Welcome to my homepage&amp;quot;&lt;br /&gt;
    set body &amp;quot;This is the main text part of the homepage&amp;quot;&lt;br /&gt;
  %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;&lt;br /&gt;
      &amp;lt;title&amp;gt;&amp;lt;%= $title %&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
    &amp;lt;body&amp;gt;&lt;br /&gt;
      &amp;lt;%= $body %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;p&amp;gt;Now let's count to 10!&amp;lt;/p&amp;gt;&lt;br /&gt;
      &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;%&lt;br /&gt;
         for {set i 1} {$i &amp;lt;= 10} {incr i} {&lt;br /&gt;
            ns_adp_puts &amp;quot;$i &amp;quot;&lt;br /&gt;
         }&lt;br /&gt;
      %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
  &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Setting ''title'' and ''body'' as variables was pretty pointless in this case. In your real website, however, these values could be taken from the database by one ADP, which in turn uses [[ns_adp_include]] to include another ADP to format the page and which can be re-used by many pages on your site.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category Documentation]] - [[Category Tutorial]]&lt;/div&gt;</summary>
		<author><name>Bootiack</name></author>
		
	</entry>
</feed>