Categories




Check A Date Is Valid

This example displays a form on a page . The user then enters a date , if the date is invalid then a message will be displayed on the screen . Examples of valid dates are as follows

12-12-09

12/12/09
<form method =”post” action=”<%= Request.ServerVariables(“SCRIPT_NAME”) %>”>
<input type =”text” name=”date”><br>
<input type=”submit”>
</form>
<%

Dim strDate , blnValid , dteDate
If Request.ServerVariables(“CONTENT_LENGTH”) <>0 Then
strDate [...]

More accurate text counter

This is a more accurate counter than our previous example , in this example the count only gets incremented once per session . This means your count will be more accurate if you want it to be that is.

Create a txt file and put your starting number in it . Then copy the code snippet [...]

Create an XML file

In this example we are going to create a simple XML document on the web server . The structure of the document will be as follows .

<?xml version=”1.0″ ?>
<news>
<newsitem>
<title>programmingsite.co.ukP</title>
<link>http://www.programmingsite.co.uk</link>
<description>programming resources</description>
</newsitem>
</news>

Anyway lets go with the code to create this example

<%@LANGUAGE = “VBScript” %>
<%
Response.Buffer = False
‘ensure proper headers sent to the client
Response.ContentType = “text/xml”
%>
<?xml version=”1.0″?>
<%

‘these are our [...]