Sambar Server Samples

Financial Tools Samples
Sambar Server DLL code: samples/source/finance.c
Mortgage Calculator
Amortization Schedule
Monthly Deposits
Present Sum Calculator
Interest Rate Calculator

ISAPI Extensions
Sambar Server ISAPI code: samples/isapi/isapitest.c
ISAPI Test Page

CGI Upload
Sambar Server CGI code: cgi-bin/upload.pl
Upload Test Page

Network Tools Samples
Sambar Server DLL code: samples/source/netutils.c
IP Lookup
WHOIS Lookup
Finger Lookup

Server-side Includes
#include directive
#echo directive
#exec wincgi directive
#exec cgi directive
#exec cmd directive
#RPC directive

Page Counter
Sambar Server DLL code: samples/source/general.c

To use the counter, you must create a file in the tmp directory to hold the page count. The file should initially contain the character 0 (you'll find the files tmp/index and tmp/samples corresponding with the counters found on the index.htm page and this page. Each time the page is referenced, the counter in the file is incremented. If a file corresponding to the counter page you pass to the /session/pagecount application does not exist, the count of 0 will be returned.

Security Code
The following links illustrate the samples found in the samples/source/security.c sample code:

  • Restrict Users access to a directory by placing a rule in the [restrict] section of the config/security.ini file. This link is restricted to the user 'billy-bob', no password.

  • Refer Users accessing a site that has been moved by placing a rule in the [redirect] section of the config/security.ini file. This link refers the client to http://www.sambar.com.

CGI/WinCGI
CGI/1.1 samples can be found in the cgi-bin directory.

The environ.pl sample illustrates the CGI environment variables defined for use with the Sambar Server.

The dumpenv.pl sample also illustrates the CGI environment variables defined for use with the Sambar Server. This script shows all variables in the environment. The Sambar Server passes the environment of the server along with the CGI environment.

An additional Perl financial application compares mortgates has been provided by Kevin Anderson.

The Guest Book sample is a simple Perl message book.

The following illustrates a simple Perl CGI script for redirecting requests:


An example WinCGI program cgitest.exe can be found in the win-cgi directory. Many thanks to Dave Wedwick for providing this code and assisting with the debugging of WinCGI.

In addition, CGI and Win-CGI scripts can be "in-lined" into HTML files using the scripting language. The inline.stm page illustrates CGI includes. The inline2.stm page illustrates Win-CGI includes.

Remailer

The Feedback Form illustrates how to send internet mail from a form using the Sambar Server sa_sendmail() API and requires that the SMTP Server and SMTP Port be properly configured. Contact your network administrator for an SMTP Server appropriate for your mail.

The MailIt Form illustrates how to send internet mail from a form using the mailit.exe executable that ships with the Sambar Server (similar to BLAT). You must know your SMTP Server to use this form.


© 1998 Sambar Technologies, Inc. All rights reserved.