Pascal server page

From Wikipedia, the free encyclopedia

A Pascal Server Page is a dynamically generated web page produced using some sort of Pascal Script interpreter on the server side. When a web request is made, the Pascal Script code gets interpreted on the server and outputted into the proper format (HTML, XML, JSON, plain text).

An example of Pascal Server Page as deployed on the server [2]:

<html>
  <head>
    <title>A Pascal Server Page</title>
  </head>
  <body>
    <% begin
         Write('Hello World');
       end.
    %>
    <p>Using Pascal Script to write a few numbers...</p>
    <% var
         i: Integer;
       begin
         for i:=1 to 10 do
           Writeln(i); 
       end.
    %>
  </body>
</html>

The code above is an HTML armature containing Pascal Script code. The Pascal Script has been isolated within the “<%” and “%>” tokens. The Pascal Script code is interpreted on the server and the output (if any) is embedded into the HTML template. If a browser asks for the page above, it will actually get plain HTML code as the one below [2]:

<html>
  <head>
    <title>A Pascal Server Page</title>
  </head> 
  <body>   
    Hello World
    <p>Using Pascal Script to write a few numbers...</p>
    1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br>
  </body>
</html>

To deploy and run Pascal Server Pages, a web server component with Pascal Scripting capabilities is required.

External links

  1. Pascal server pages for delphi/freepascal
  2. Pascal Server Pages – Pascal Script


This article is issued from Wikipedia. The text is available under the Creative Commons Attribution/Share Alike; additional terms may apply for the media files.