Mark Voss

Category: ASP

First and last day of the month

Using the VBScript DateSerial function, returning the first day of the month is straightforward: <% first_day = DateSerial(Year(Date), Month(Date), 1) %> Returning the the last day of the month is the same as returning the day before the first day of next month: <% last_day = DateSerial(Year(Date), Month(Date)+1, 1 – 1) %> Combining these into […]

VBScript date & time functions

VBScript date and time functions can be used to return the system date and time in different formats for use on web pages. They can also be combined into useful sub procedures & functions for manipulating dates & times further. In the last example, DateDiff simply returns the number of days between now and Christmas […]

Encrypting usernames and passwords

Using md5 and sha1 hash functions If you’re using a login script on your site you probably store usernames and passwords in a database for authenticating the login. For security reasons, you should never store these as plain text but should encrypt them with a one-way hash function such as md5 or sha1. As neither […]

A generic CDOSYS form-to-email script

A simple classic ASP form processing script which collects input from any form on your website and emails it to you using the CDOSYS ASP component. The user is then redirected to a page of your choice. First, build your HTML form using the usual text, textarea, checkbox, select and radio button fields. The only […]