<!--- shows the value of the dayofWeek function --->
<cfif IsDefined("form.year")>
More information about your date:
<cfset yourDate = #CreateDate(form.year, form.month, form.day)#>
<cfoutput>
<p>Your date, #DateFormat(yourDate)#.
<br>It is #DayofWeekAsString(DayOfWeek(yourDate))#, day #DayOfWeek(yourDate)# in the week.
<br>This is day #Day(YourDate)# in the month of #MonthAsString(Month(yourDate))#, which has #DaysInMonth(yourDate)# days.
<br>We are in week #Week(yourDate)# of #Year(YourDate)# (day #DayofYear(yourDate)# of #DaysinYear(yourDate)#).
<br><cfif IsLeapYear(Year(yourDate))>This is a leap year<cfelse>This is not a leap year</cfif>
</cfoutput>
</cfif>
<cfform action="index.cfm" method="POST">
<p>Please enter the year, month and day in integer format for
the date value you would like to view:
<pre>
Year <cfinput type="Text" name="year" value="1998" validate="integer" required="Yes">
Month <cfinput type="Text" name="month" value="6" validate="integer" required="Yes">
Day <cfinput type="Text" name="day" value="8" validate="integer" required="Yes">
</pre>
<p><input type="Submit" name=""> <input type="RESET">
</cfform>
<CFQUERY DATASOURCE=”CFdata” NAME=”getall”>
SELECT *
FROM Info
ORDER BY Name ASC
</CFQUERY>
Then below this code, add the following HTML:
<table align=”center” border=”1”>
<CFOUTPUT QUERY=”getall”>
<tr>
<td>#CURRENTROW#</td>
<td>#NAME#</td>
<td>#ADDRESS#<BR>#CITY# #STATE#, #ZIP#</td>
<td>#PHONE#</td>
<td>#EMAIL#</td>
<td>#NOTES#</td>
</tr>
</CFOUTPUT>
</table>
You will need to create a file called "Application.cfm" (make
sure that the A is a capital "A" and
not "a"...this is a common problem
from those who were in a Windows environment
before moving to our servers.)
Once you have created your Application.cfm
file, you will need to place some code on
the page to tell ColdFusion what to enable
and how long they should persist. We do this
using the <cfapplication> tag. Below
is a table of variables available to the <cfapplication> tag.
At its most basic, your <cfapplication> tag
should have the following elements:
Name
SessionManagement
SessionTimeout
With the above in mind, here is a basic
implementation of the <cfapplication> tag: