Home
Unix-Linux Administration
Database
Programming
Advanced Search
Resources
Contact Us
Home arrow Programming arrow Pascal arrow CGI with FreePascal
CGI with FreePascal Print
Apr 06, 2007 at 04:15 PM
{$H+}
program ex_counter;
uses web;
{ First page you should make: a hit counter.
  This one shows you how it looks like on PSP.
  Written by Trustmaster.
  http://www.psp.furtopia.org
}
var nf: text;
  nc: integer;
begin
Web_Header; // Usual HTTP header
Web_FileOut('gfx/head.html'); // Page Header file
writeln('<center><h1>Hit Counter Example</h1><h2>[');
// Counter operations:
assign(nf,'data/counter.dat');
reset(nf);
readln(nf,nc);
close(nf);
inc(nc);
rewrite(nf);
writeln(nf,nc);
close(nf);
writeln(nc);
// Done. Writing Page Footer
writeln(']</h2></center>');
Web_FileOut('gfx/foot.html');
end.