Web Server
Sartronics.com Peasy Mail server comes with an in built light web server. It is used to display a basic web site. Peasy Web Server supports a set of special instruction to support shopping carts, statistics and allow common HTML sections to use single files.
To set it up all that is required is to specify a folder where the web site's HTML files are kept it along with the home page and to enable the IP port on which to listen.
The web server options are available from the menu Server > Web server options.
.
Web wizard
To get started quick with a brand new website just use the web wizard from the menu Server > Web wizard. It will quick generate a simple demonstration web site. This can then be used as starting point for a working web site. Using the web editor the
Web Editor
To easily edit the web site pages use the web editor from the menu Server > Web editor.
Special instructions
The special instructions are inserted into HTML files. They all have the following format.
<?Peasy ... />
This ables the code to be used in HTML files without any confict. The <? and /> follow the rules for HTML tag. The <?Peasy make it a special tag that is only understood by the Sartronics Peasy Web Server. Other Web servers will just ignore this and send it on as part of the HTML file. Note that these special instuctions can not be embedded into other HTML tags, that would break the rules for HTML format.
The Peasy Web Server will remove these instructions and replace it with the intended HTML data if any.
The following list the supported special instructions. Note that they can be easily set and adjusted with the Web Editor.
|
Product Create parameter types
|
Customer Cart parameters
|
Customer Cart Col (column) parameters
|
Customer Details parameters
|
Customer Details field parameters
|
Customer Details field Attrib (Attribute) type
|
HREF to add a product to a customers cart
To add a product to a customers cart use the following at the end of the href file path.
<a href="../cart.html?for=cart&add=MyCode1">
This will open up the page ../cart.html and place the product with code MyCode1 onto the customers list.
Stats (Statistics) Pages parameters
|
Stats (Statistics) Pages Col (column) parameters
|
Stats (Statistics) Pages Page parameters
|
Stats (Statistics) Visitors parameters
|
Stats (Statistics) Visitors Col (column) parameters
|
Stats (Statistics) Visitors Col (column) Attrib (Attributes)
|
Stats (Statistics) Visits Types
|
Graph Pages parameters
|
Graph Pages Axis parameters
|
Action Email parameters
|
Example of first HTML entry page
This creates the products. The products only need to be created once after a restart.
<html>
<?Peasy products.create(code="MyCode1",price="US$100.00",name="Super Product",summary="Super product everyone needs",thumbnail="pic1.png") />
<?Peasy products.create(code="MyCode2",price="US$200.00",name="Super Product 2",summary="Super product everyone absolutely needs="pic2.png") />
<body>
<?Peasy include(file="banner.html") />
<?Peasy include(file="sidebar.html") />
<p>We offer super products.</p>
<?Peasy include(file="footer.html") />
</body>
</html>
Example of first HTML entry page with product prices
This creates the products. The products only need to be created once after a restart. It also lists the products with its prices.
<html>
<?Peasy products.create(code="MyCode1",price="US$100.00",name="Super Product",summary="Super product everyone needs",thumbnail="pic1.png") />
<?Peasy products.create(code="MyCode2",price="US$200.00",name="Super Product 2",summary="Super product everyone absolutely needs="pic2.png") />
<body>
<?Peasy include(file="banner.html") />
<?Peasy include(file="sidebar.html") />
<p>We offer super products.</p>
<p><a href="../cart.html?for=cart&add=MyCode1"> Super Product 1 costs <?Peasy products.text(code=SA-Win,attrib=price) />.</a></p>
<p><a href="../cart.html?for=cart&add=MyCode1"> Super Product 2 costs <?Peasy products.text(code=MyCode2,attrib=price) />.</a></p>
<?Peasy include(file="footer.html") />
</body>
</html>
Example of cart.html page
This shows the customers shopping cart
<html>
<body>
<?Peasy include(file="banner.html") />
<?Peasy include(file="sidebar.html") />
<h2>Shopping cart contents</h2>
<?Peasy customer.cart(nextpage=checkout.html,button="Proceed to checkout",updatebutton="Update",width=77,col(width=32,height=32,attrib=thumbnail),col(name="Product",width=150,attrib=name),col(name="Description",width=400,attrib=summary),col(name="Price",width=50,attrib=price),col(name="Quantity",width=50,attrib=quantity),col(name="Total",width=50,attrib=total)) />
<br />
<p> <font color="yellow">To remove an item from cart set the quantity to 0.</font></p>
<br />
<p> </p>
<?Peasy include(file="footer.html") />
</body>
</html>
Example of checkout.html page
This asks for the customers details
<html>
<body>
<?Peasy include(file="banner.html") />
<?Peasy include(file="sidebar.html") />
<h2>Checkout</h2>
<p>Please enter the following details and press purchase</p>
<?Peasy customer.details(nextpage=thankyou.html,button="Purchase",width=77,field(label="Your first name",attrib=name,required),field(label="Your family name",attrib=surname,required),field(label="Company / Organisation name",attrib=company),field(label="Your email",attrib=email,required),field(label="Credit card type",attrib=cctype.visa,units="Visa"),field(attrib=cctype.master,units="Mastercard",sameline=yes),field(label="Credit card number",attrib=ccnumber,units="(spaces permitted)",required),field(label="Credit card expiry",attrib=ccmonth,required),field(label="/",attrib=ccyear,required=yes,sameline=yes),field(label="Name on credit card",attrib=ccname,required),field(label="Credit card validation code",attrib=ccvalid,required,mask=8),field(label="Addition notes:",attrib=notes,multiline,cols=55,rows=8)) />
<br />
<p> </p>
<?Peasy include(file="footer.html") />
</body>
</html>
Example of thankyou.html page
This thanks the customer and generates the purchase
<html>
<body>
<?Peasy include(file="banner.html") />
<?Peasy include(file="sidebar.html") />
<?Peasy customer.save(file="C:\ProgramData\PeasyMailServer\orders.txt") />
<?Peasy customer.email(to=sales@sartronics.com) />
<h2>Thank you</h2>
<p>Thank you for your purchase.</p>
<p>We will be in contact you with.</p>
<p>If you have any further quiries please refer to your purchase reference number <?Peasy customer.ref?>.</p>
<br>
<p> </p>
<a href="index.html">Return to home page.</a>
<?Peasy include(file="footer.html") />
</body>
</html>
Example of banner.html page
This is the common banner page.
<style type="text/css">
.banner_A{border-collapse:collapse;table-layout:auto;border: 0px solid #000000;}
.banner_B{padding: 10px 10px 10px 10px;border-left: 3px solid #FF7FFF;border-top: 3px solid #FF7FFF;border-right: 3px solid #FF7FFF;border-bottom: 3px solid #FF7FFF;background-color:#FFFFFF;vertical-align:middle;background-image:url(marble.jpg);}
.banner_C{font-family:Arial,Helvetica,sans-serif;font-size:32pt;font-weight:bold;font-style:italic;color:#0000FF;margin:0 0 0 0;}
.banner_D{font-family:Arial,Helvetica,sans-serif;font-size:16pt;text-align:right;margin:5 0 5 0;}
.banner_E{font-family:Arial,Helvetica,sans-serif;font-size:16pt;text-align:center;margin:5 0 5 0;}
.banner_F{font-family:Arial,Helvetica,sans-serif;font-size:10pt;text-align:center;margin:5 0 5 0;}
</style>
<table width="100%" class="banner_A" style="margin: 0px 0px 0px 0px">
<colgroup><col width="100%"></colgroup>
<tr>
<td class="banner_B">
<p class="banner_C">
<img src="/banner_0.png" width="128" height="128" alt="banner_0.png">
mywebsite.com
</p>
<p class="banner_D"><a href="index.html">foo.com</a> is the place for wonderful smiles </p>
</td>
</tr>
</table>
Example of sidebar.html page
This is the common sidebar page.
<div style="float:left;width:210px;">
<style type="text/css">
.leftside_A{border-collapse:collapse;table-layout:auto;border: 0px solid #000000;}
.leftside_B{padding: 10px 10px 10px 10px;border-left: 3px solid #FF7FFF;border-top: 3px solid #FF7FFF;border-right: 3px solid #FF7FFF;border-bottom: 3px solid #FF7FFF;background-color:#FFFFFF;vertical-align:middle;background-image:url(marble.jpg);}
.leftside_C{font-family:Arial,Helvetica,sans-serif;font-size:32pt;font-weight:bold;font-style:italic;color:#0000FF;margin:0 0 0 0;}
.leftside_D{font-family:Arial,Helvetica,sans-serif;font-size:16pt;text-align:right;margin:5 0 5 0;}
.leftside_E{font-family:Arial,Helvetica,sans-serif;font-size:16pt;text-align:center;margin:5 0 5 0;}
.leftside_F{font-family:Arial,Helvetica,sans-serif;font-size:10pt;text-align:center;margin:5 0 5 0;}
</style>
<p class="leftside_F"> </p>
<table width="100%" class="leftside_A" style="margin: 0px 0px 0px 0px">
<colgroup><col width="100%"></colgroup>
<tr>
<td class="leftside_B">
<div class="leftside_E"><a href="/index.html">Home</a></div>
</td>
</tr>
</table>
<p class="leftside_F"> </p>
<table width="100%" class="leftside_A" style="margin: 0px 0px 0px 0px">
<colgroup><col width="100%"></colgroup>
<tr>
<td class="leftside_B">
<div class="leftside_E"><a href="/products.html">Products</a></div>
</td>
</tr>
</table>
</div>
Example of footer.html page
This is the common footer page.
<style type="text/css">
.footer_A{border-collapse:collapse;table-layout:auto;border: 0px solid #000000;}
.footer_B{padding: 10px 10px 10px 10px;border-left: 3px solid #FF7FFF;border-top: 3px solid #FF7FFF;border-right: 3px solid #FF7FFF;border-bottom: 3px solid #FF7FFF;background-color:#FFFFFF;vertical-align:middle;background-image:url(marble.jpg);}
.footer_C{font-family:Arial,Helvetica,sans-serif;font-size:32pt;font-weight:bold;font-style:italic;color:#0000FF;margin:0 0 0 0;}
.footer_D{font-family:Arial,Helvetica,sans-serif;font-size:16pt;text-align:right;margin:5 0 5 0;}
.footer_E{font-family:Arial,Helvetica,sans-serif;font-size:16pt;text-align:center;margin:5 0 5 0;}
.footer_F{font-family:Arial,Helvetica,sans-serif;font-size:10pt;text-align:center;margin:5 0 5 0;}
</style>
<table width="100%" class="footer_A" style="margin: 0px 0px 0px 0px">
<colgroup><col width="100%"></colgroup>
<tr>
<td class="footer_B">
<p class="footer_F">Copyright MyWebSite.com (2010)</p>
</td>
</tr>
</table>
Example of hit count statistics table page
This is page produces the number of hit counts, since the statistics were reset and a hit count table.
<h2>Pages Statistics</h2>
<p>
Number of visitors <?Peasy stats.visits(type=all)/> since <?Peasy stats.since/> with a daily average of <?Peasy stats.visits(type=day)/>.
The Server has been running since <?Peasy uptime />.
</p>
<h3>Web Pages Hit Counts</h3>
<p>
<?Peasy stats.pages(col(name="Page Name",width=600,attrib=name),col(width=200,attrib=hitcnt,days=14),col(name="Average",width=200,attrib=hitcntav)) />
</p>
Example of a visitors table page
This is page produces the number of hit counts, since the statistics were reset and two visitors tables. One to show the number of unique visitors and one to show all visitors including webbots and local connections.
<h2>Visitors Statistics</h2>
<p>
Number of visitors <?Peasy stats.visits(type=all)/> since <?Peasy stats.since/> with a daily average of <?Peasy stats.visits(type=day)/>.
The Server has been running since <?Peasy uptime/>.
</p>
<h3>Browser Web Visitors</h3>
<p>
Total count is <?Peasy stats.visitorcnt(only=browser)/>.
</p>
<p>
<?Peasy stats.visitors(only=browser,col(name="Address",width=400,attrib=address),col(name="Name",width=600,attrib=name),col(name="Last visit",width=300,attrib=since),col(name="Visits",width=200,attrib=visits)) />
</p>
<h3>Web Visitors</h3>
<p>
<?Peasy stats.visitors(norobot,nolocal,col(name="Address",width=400,attrib=address),col(name="Name",width=600,attrib=name),col(name="Last visit",width=300,attrib=since),col(name="Visits",width=200,attrib=visits)) />
</p>
<h3>Web Visitors (including webbots and local connections)</h3>
<p>
Total count is <?Peasy stats.visitorcnt() />.
</p>
<p>
<?Peasy stats.visitors(col(name="Address",width=400,attrib=address),col(name="Name",width=600,attrib=name),col(name="Last visit",width=300,attrib=since),col(name="Browser",width=100,attrib=browser),col(name="Robot",width=100,attrib=robot),col(name="Local",width=100,attrib=local),col(name="Visits",width=200,attrib=visits)) />
</p>
Example of hit count graph page
This is page shows then number of hit counts, since the statistics were reset and a hit count bar graph.
<h3>Web Pages Hit Counts Chart</h3>
<p>
<?Peasy graph.pages(width=1000,height=600,x(label="Date from today"),y(label="Hit Count")) />
</p>