Skip to main content
March 26, 2011
Answered

storing session variables and retrieving them

  • March 26, 2011
  • 3 replies
  • 3054 views

A few months ago i wrote a web application that uses session to store user input as they move from one page to another.It was very successful.Then i tried to retrieve the data back into the field fromt the database when the user logs back after a logout but i was unssuccessful. This is my script. All i want to knw is that is there a way to store and retrieve my session or fill my input fill with the data from the database.

I am using cf9 and mysql on a window7

<cfset numberofSteps = 5>

<!--The session.registration structure holds user's entries-->

<!--As they move through the wizard make sure it exist-->

<cfif not isdefined("session.registration")>

<!--If structures does not exist create / initialize it-->

<cfset session.registration = structNew()>

<!--Represent Current Wizard Step start at One-->

<cfset session.registration.stepNum = 1>

<!--We will collect these from user;start at One-->

<!--We will collect these from user;start at One-->

<cfset session.registration.firstname="">

<cfset session.registration.lastname ="">

<cfif isDefined("form.fname")>

<cfset session.registration.firstname=form.fname>

<cfset session.registration.lastname =form.lname>

<cfform action="action="index.cfm?StepNum=#URLEncodedFormat(session.registration.stepNum)#" method="post" preservedata="yes"" method="post" >

<cfswitch expression="#session.registration.stepNum#">

<cfcase value="1">

<cfinput name="fname"  type="text"   VALUE="#session.registration.firstname#"  onChange="javascript:this.value=this.value.toUpperCase();" class="EGIT-txt" required="true" validateat="onSubmit" message="You must enter a First Name." />

<cfinput name="lname"  type="text"   VALUE="#session.registration.lastname#" class="EGIT-txt" required="true" validateat="onSubmit" message="You must enter a Last Name." onChange="javascript:this.value=this.value.toUpperCase();" />

</cfcase>

</cfform>

    This topic has been closed for replies.
    Correct answer talofer99

    Am wondering how it will knw the VALUE="#session.registration.firstname#"   is for the field firstname in the database. OR am i to do some <output query="queryname"> </output> around the input and select tags


    You can do that

    <output query="queryname"> #firstname#</output>

    OR

    <output query=""> #queryname.firstname#</output>

    NOTE: in the first option if there is more then one line in the databse (data inegrity issue) they will be more hten one table presented (since it will loop over the lines in the cfoutput)

    in the sec. option it will take the value of the FIRST record in the QUERY, regadless of how many lines are in the query.

    Hope this clear things out for u ...

    3 replies

    talofer99
    Inspiring
    March 27, 2011

    Session scope will be released with in 3hrs (your setting in the application.cfm)

    So as long as the user came back with in that time frame the info will be there .... longer then that ... no ....

    So if ur problem if that the user leave .. and come back more then 3hrs later.. then the problem is within the timespan of the session.

    If this is not the case, then please exlpain ..

    talofer99
    Inspiring
    March 27, 2011

    one more note ...

    if u do nees to store info, the SESSION scope is not highly recomended, Use a databse (temp table), and a sessio id or a cockie to relate to the data line.

    March 27, 2011

    if u do nees to store info, the SESSION scope is not highly recomended, Use a databse (temp table), and a sessio id or a cockie to relate to the data line.

    Please can you explain to me how to Use a database (temp table), and a session id to relate to the dataline.

    PS.I destroy my sessions when logging out  using

    <cflock scope="SESSION" throwontimeout="Yes" timeout="7" type="EXCLUSIVE">

    <cfset  StructDelete(Session, "User",true)>

        <cfset  StructDelete(Session, "registration",true)>

    </cflock>

    March 27, 2011

    Tis is my Application.cfc

    <cfset this.name = "loginSecurity">

    <cfset this.applicationTimeout = CreateTimeSpan(0,3,0,0)>

    <cfset this.sessionManagement = "true">

    <cfset this.sessionTimeout = CreateTimeSpan(0,3,0,0)>

    <cfset this.clientManagement = "false">

    How do i apply the quick q

    1.All i want is to retrieve data back when the user signs in again and since am using VALUE="#session.registration.lastname#" i dont knw how to do that

    talofer99
    Inspiring
    March 27, 2011

    I'm not sure what you are trying to do .. so I'm not sure what is failing ...

    Can you explain to me what you are trying to achive, and I then might be able to help you out with the how ....

    It will defently help if u post all the code of this page, since some of it is missing, I can see a CFIF with no /cfif ... so its hard to follow all the logic of hte page ..

    March 27, 2011

    So this is what i have. And what i want to achieve is when the user logs out and logs back in what ever he entered will be there for him to continue.

    This my website and working on http://mohadmissions.com/pgadmission/ scratchcard number:123456789 pin:0000 you can try it out.

    <!---Total Number of Step in the Wizard--->

    <cfset numberofSteps = 5>

    <!--The session.registration structure holds user's entries-->

    <!--As they move through the wizard make sure it exist-->

    <cfif not isdefined("session.registration")>

    <!--If structures does not exist create / initialize it-->

    <cfset session.registration = structNew()>

    <!--Represent Current Wizard Step start at One-->

    <cfset session.registration.stepNum = 1>

    <!--We will collect these from user;start at One-->

    <!--We will collect these from user;start at One-->

    <cfset session.registration.title="">

    <cfset session.registration.firstname="">

    <cfset session.registration.lastname ="">

    <cfset session.registration.date="">

    <cfset session.registration.nationality="">

    <cfset session.registration.email="">

    <cfset session.registration.marital="">

    <cfset session.registration.gender="">

    <cfset session.registration.country="">

    <cfset session.registration.region="">

    <cfset session.registration.address="">

    <cfset session.registration.telephone="">

    <cfset session.registration.language="">

    <cfset session.registration.city="">

    <cfset session.registration.parentname="">

    <cfset session.registration.parenttel="">

    <cfset session.registration.parentadd="">

    <cfset session.registration.parentemail="">

    <cfset session.registration.parentreg="">

    <cfset session.registration.parentcountry="">

    <cfset session.registration.ptypeid="">

    <cfset session.registration.catid="">

    <cfset session.registration.catype="">

    <cfset session.registration.institution01="">

    <cfset session.registration.institution02="">

    <cfset session.registration.institution03="">

    <cfset session.registration.grade1="">

    <cfset session.registration.grade2="">

    <cfset session.registration.grade3="">

    <cfset session.registration.periodfrom1="">

    <cfset session.registration.periodfrom2="">

    <cfset session.registration.periodfrom3="">

    <cfset session.registration.periodto1="">

    <cfset session.registration.periodto2="">

    <cfset session.registration.periodto3="">

    <cfset session.registration.basicq1="">

    <cfset session.registration.basicq2="">

    <cfset session.registration.basicq3="">

    <cfset session.registration.Employer="">

    <cfset session.registration.Employer_type="">

    <cfset session.registration.job_title="">

    <cfset session.registration.Employer1="">

    <cfset session.registration.Employer_type1="">

    <cfset session.registration.job_title1="">

    <cfset session.registration.Employer2="">

    <cfset session.registration.Employer_type2="">

    <cfset session.registration.job_title2="">

    </cfif>

    <!--If the User submitted FirstName,remember it-->

    <!--Do the Same for the rest of the values-->

    <cfif isDefined("form.title_id")>

    <cfset session.registration.title=form.title_id>

    <cfset session.registration.firstname=form.fname>

    <cfset session.registration.lastname =form.lname>

    <cfset session.registration.date=form.date>

    <cfset session.registration.nationality=form.nationality>

    <cfset session.registration.email=form.email>

    <cfset session.registration.marital=form.martial>

    <cfset session.registration.gender=form.gender>

    <cfset session.registration.country=form.country>

    <cfset session.registration.region=form.region>

    <cfset session.registration.address=form.address>

    <cfset session.registration.telephone=form.telephone>

    <cfset session.registration.language=form.lang>

    <cfset session.registration.city=form.city>

    <cfset session.registration.parentname=form.parentname>

    <cfset session.registration.parenttel=form.parenttel>

    <cfset session.registration.parentadd=form.parentadd>

    <cfset session.registration.parentemail=form.parentemail>

    <cfset session.registration.parentreg=form.parentreg>

    <cfset session.registration.parentcountry=form.parentcountry>

    </cfif>

    </cfoutput>

    <cfif  isDefined("form.institution01")>

    <cfset session.registration.institution01=form.institution01>

    <cfset session.registration.institution02=form.institution02>

    <cfset session.registration.institution03=form.institution03>

    <cfset session.registration.grade1=form.grade1>

    <cfset session.registration.grade2=form.grade2>

    <cfset session.registration.grade3=form.grade3>

    <cfset session.registration.periodfrom1=form.periodfrom1>

    <cfset session.registration.periodfrom2=form.periodfrom2>

    <cfset session.registration.periodfrom3=form.periodfrom3>

    <cfset session.registration.periodto1=form.periodto1>

    <cfset session.registration.periodto2=form.periodto2>

    <cfset session.registration.periodto3=form.periodto3>

    <cfset session.registration.basicq1=form.basicq1>

    <cfif isDefined("form.employer")>

    <cfset session.registration.employer=form.employer>

    <cfset session.registration.employer_type=form.employer_type>

    <cfset session.registration.job_title=form.job_title>

    <cfset session.registration.employer1 =form.employer1 >

    <cfset session.registration.employer_type1 =form.employer_type1 >

    <cfset session.registration.job_title1 =form.job_title1 >

    <cfset session.registration.employer2 =form.employer2 >

    <cfset session.registration.employer_type2 =form.employer_type2 >

    <cfset session.registration.job_title2 =form.job_title2 >

    </cfif>

    </cfoutput>

    <cfif isDefined("form.ProgramID")>

    <cfset session.registration.ptypeid=form.ProgramID>

    <cfset session.registration.catid=form.schnum>

    <cfset session.registration.catype=form.catype>

    </cfif>

    <!--if the clicked "back" button, go back a step-->

    <cfif isdefined("form.goBack")>

    <cfset session.registration.stepNum = url.stepNum - 1 >

    <!---If  user clicked "Next" button, go forward one --->

    <cfelseif isDefined("form.goNext")>

    <cfset session.registration.stepNum = url.stepNum + 1>

    <!--If the User clicks "Finish" button,We're done-->

    <cfelseif isDefined("form.goDone")>

    <cflocation url="newApplicationWizard.cfm">

    </cfif>

    <cfset percent = (#session.registration.StepNum# * 20)>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>.::APPLY | Ministry of Health Online Application</title>

    <head >

    <title>

    General Application Form

    </title>

    <meta name="Keywords" />

    <meta name="Description" />

    <meta name="robots" content="All" />

    <meta name="author" />

    <meta name="copyright" />

    <meta name="revisit-after" content="7 days" />

    <link rel="stylesheet" href="css/style.css" type="text/css" media="all" />

    <link href="css/jquery-ui-1.8.10.custom.css" media="screen, projection" rel="stylesheet" type="text/css"/>

        <!--[if IE]>

    <link rel="stylesheet" href="../MasterPages/css/style_ie.css" type="text/css" media="all" />

    <![endif]-->

        <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />

        <script type="text/javascript" src="../js/Calendar.js"></script> 

                <script type="text/javascript" src="../js/jquery-1.4.4.min.js"></script>

    <script type="text/javascript" src="../js/jquery-ui-1.8.10.custom.min.js"></script>

        <script>

    $(function() {

    $( "#datepicker" ).datepicker({

    changeMonth: true,

    changeYear: true

    });

    });

    </script>

    </head>

    <body onbeforeunload ="showWait()" >

    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">

      <!--DWLayoutTable-->

      <tr>

        <td width="8" height="22"> </td>

        <td width="1063"> </td>

        <td width="11"> </td>

      </tr>

      <tr>

        <td height="50"> </td>

        <td valign="top"><table width="950" border="0" align="center" cellpadding="0" cellspacing="0">

          <!--DWLayoutTable-->

          <tr>

            <td width="1072" height="50"><table width="850" border="0" align="center">

          <tr>

            <td width="19%"><img src="images/logo_header.png" width="600" height="100" /></td>

            <td width="43%"><div id="login" class="logged" style="padding-right:8px;padding-bottom:15px;padding-top:5px;"><cfoutput>

              Welcome #Session.User.firstname# #Session.User.lastname#! #Session.User.LoginMessage#<br/><br/>

              Click To Logout: <a href="logout.cfm">LOGOUT</a><br/>

              <!---Number of logged in users: #Application.currentSessions#--->

            </cfoutput>

              </div>

            </td>

          </tr>

          <br/>

        </table>

              <table width="850" align="center">              

        <tr>

            <td style="padding-bottom:0px;">

                <span  style="color:Black;font-size:X-Large;">POST BASIC APPLICANTS FORM</span>

            </td>

        </tr>

    </table>

              <table width="920" border="0">

                <tr>

                  <td width="80%">  <div class="title-bar">

            <div class='title-bar'><div class='title-bar'><p class='f-right'><span class='pct'><strong><cfoutput>#percent#% complete</cfoutput></strong></span></p><h3 style='font-weight:bold;'><cfoutput>Step #session.registration.StepNum# of #NumberOfSteps#  |

    <cfif #session.registration.stepNum# EQ 1 >

    Personal Information

    <cfelseif #session.registration.stepNum# EQ 2 >

    Educational Information

    <cfelseif #session.registration.stepNum# EQ 3 >

    Academics Information

    <cfelseif #session.registration.stepNum# EQ 4 >

    Working Experience Information

    <cfelseif #session.registration.stepNum# EQ 5 >

    Upload Photo & Submit Application

    </cfif>

    </cfoutput></h3>

            </div>

            <table><tr><td class='NormalText-TD-NoPadding'>Please complete our online application form for the position you have selected. <br />The first two steps are mandatory, after which you can skip steps and come back to complete the rest of the application process. <br />However, should your application not be fully completed within 3 months, your details will automatically be deleted.<br /><br />An asterisk (<span style='color:Red;'>*</span>) indicates mandatory fields.</td></tr></table>

        </div>

        <!--Data Entry Form Which submit Back to It's Self-->

        <cfform action="index.cfm?StepNum=#URLEncodedFormat(session.registration.stepNum)#" method="post" preservedata="yes">

        <!---Display the appropriate wizard Step--->

        <cfswitch expression="#session.registration.stepNum#">

    <!---Step one :Personal Information--->

    <cfcase value="1">

        <h3 class="head_grey_big">

            <span>Personal Details</span></h3>

        <table width="100%" border="0" class="Align-Right">

          <tr>

            <td width="1%" align="left" valign="top"> </td>

            <td width="99%"><table width="100%" border="0">

              <tr>

                <td width="33%"><span class="NormalText-TD">Title</span><span class='mandatory'>*</span></td>

                <td width="34%"><span class="NormalText-TD">Last Name (Family Name)</span><span class="mandatory">*</span></td>

                <td width="33%"><span class="NormalText-TD">First Name (Given Name)</span><span class="mandatory">*</span></td>

              </tr>

              <tr>

                <td><span class="NormalText-TD">

                  <cfsilent>

                    <cfquery name="get_title" datasource="#request.datasource#"  >

                      SELECT  *  FROM TITLE ORDER BY title_id

                      </cfquery>

                    </cfsilent>

                  <cfselect name="title_id" query="get_title" queryposition="below" value="name" display="name" selected="#session.registration.title#"  required="yes"  validateat="onSubmit" message="Please select a Title">

                    <option value = "" >Please Select....</option>

                    </cfselect>

                </span></td>

                <td><span class="NormalText-TD">

                  <cfinput  type="text" name="fname" message="You must enter a First Name." validateat="onSubmit" required="true" class="EGIT-txt"  onChange="javascript:this.value=this.value.toUpperCase();"   VALUE="#session.registration.firstname#" maxlength="150" />

                </span></td>

                <td><span class="NormalText-TD">

                  <cfinput  type="text" name="lname" message="You must enter a Last Name." validateat="onSubmit" required="true" class="EGIT-txt" onChange="javascript:this.value=this.value.toUpperCase();"   VALUE="#session.registration.lastname#" maxlength="150" />

                </span></td>

              </tr>

              <tr>

                <td> </td>

                <td> </td>

                <td> </td>

              </tr>

              <tr>

                <td><span class="NormalText-TD">Date Of Birth(DD-MM-YYYY) </span><span class='mandatory'>*</span></td>

                <td><span class="NormalText-TD">Present Nationality</span><span class='mandatory'> *</span></td>

                <td><span class="NormalText-TD">Email</span><span class='mandatory'> *</span></td>

              </tr>

              <tr>

                <td><span class="NormalText-TD">

                  <div class="demo">

                        <cfinput name="date" id="datepicker" VALUE="#session.registration.date#"  type="text"  class="EGIT-txt" maxlength="100"  />

                        </div>

                </span></td>

                <td><span class="NormalText-TD">

                  <cfsilent>

                    <cfquery name="get_nationality" datasource="#request.datasource#"  >

                      SELECT  *  FROM nationality ORDER BY nationality

                      </cfquery>

                    </cfsilent>

                  <cfselect  name="nationality" queryposition="below" query="get_nationality" value="name" display="name" selected="#session.registration.nationality#" required="yes" message="Please select a

    Nationality" >

                    <option value = "" >--Nationality--</option>

                    </cfselect>

                </span></td>

                <td><span class="NormalText-TD">

                  <cfinput type="text" name="email" message="Please select a

    email"  validate="email" required="yes"  class="EGIT-txt" onChange="javascript:this.value=this.value.toUpperCase();" VALUE="#session.registration.email#" maxlength="50" />

                </span></td>

              </tr>

              <tr>

                <td> </td>

                <td> </td>

                <td> </td>

              </tr>

              <tr>

                <td><span class="NormalText-TD">Marital Status</span><span class='mandatory'> *</span></td>

                <td><span class="NormalText-TD">Gender</span><span class='mandatory'> *</span></td>

                <td><span class="NormalText-TD"> <span >Country<span class='mandatory'> *</span></span></span></td>

              </tr>

              <tr>

                <td><span class="NormalText-TD">

                  <cfsilent>

                    <cfquery name="get_martial" datasource="#request.datasource#"  >

                      SELECT  *  FROM marital ORDER BY martial

                      </cfquery>

                    </cfsilent>

                  <cfselect    name="martial" query="get_martial" queryposition="below" value="name" display="name" selected="#session.registration.marital#" required="yes" message="Please select a

    Marital Status">

                    <option value = "" >--Marital--</option>

                    </cfselect>

                </span></td>

                <td><span class="NormalText-TD">

                  <cfsilent>

                    <cfquery name="get_gender" datasource="#request.datasource#"  >

                      SELECT  *  FROM gender ORDER BY gender

                      </cfquery>

                    </cfsilent>

                  <cfselect    name="gender" query="get_gender" queryposition="below" value="name" display="name" selected="#session.registration.gender#" required="yes" message="Please select a

    Gender">

                    <option value = "" >--Gender--</option>

                    </cfselect>

                </span></td>

                <td><span class="NormalText-TD">

                  <cfsilent>

                    <cfquery name="get_country" datasource="#request.datasource#"  >

                      SELECT  *  FROM country ORDER BY country

                      </cfquery>

                    </cfsilent>

                  <cfselect    name="country" query="get_country" queryposition="below" value="name" display="name" selected="#session.registration.country#" required="yes" message="Please select a

    Country">

                    <option value = "" >--Country--</option>

                    </cfselect>

                </span></td>

              </tr>

              <tr>

                <td> </td>

                <td> </td>

                <td> </td>

              </tr>

              <tr>

                <td><span class="NormalText-TD">Region</span><span class='mandatory'> *</span></td>

                <td><span class="NormalText-TD">Address</span><span class='mandatory'> *</span></td>

                <td><span class="NormalText-TD">Telephone Number of Applicant</span><span class='mandatory'> *</span></td>

              </tr>

              <tr>

                <td><cfsilent>

                  <cfquery name="get_region" datasource="#request.datasource#"  >

                      SELECT  *  FROM region ORDER BY region

                      </cfquery>

                  </cfsilent>

                  <cfselect    name="region" query="get_region" queryposition="below" value="name" display="name" selected="#session.registration.region#" required="yes" message="Please select a

    Region"  onChange="javascript:this.value=this.value.toUpperCase();" >

                    <option value = "" >--Region--</option>

                  </cfselect></td>

                <td><span class="NormalText-TD">

                  <cfinput name="address" VALUE="#session.registration.address#" type="text"  class="EGIT-txt" size="28" maxlength="200" required="yes" message="Please select a

    Address" onChange="javascript:this.value=this.value.toUpperCase();" />

                </span></td>

                <td><span class="NormalText-TD">

                  <cfinput  name="telephone" type="text" VALUE="#session.registration.telephone#" class="EGIT-txt" size="25" maxlength="50" required="yes" message="Please select a

    Telephone"  validate="integer" onChange="javascript:this.value=this.value.toUpperCase();" />

                </span></td>

              </tr>

              <tr>

                <td> </td>

                <td> </td>

                <td> </td>

              </tr>

              <tr>

                <td><span class="NormalText-TD">Languages</span><span class='mandatory'> *</span></td>

                <td>City</td>

                <td> </td>

              </tr>

              <tr>

                <td><span class="NormalText-TD">

                  <cfinput name="lang" type="text" VALUE="#session.registration.language#" class="EGIT-txt" size="25" maxlength="100"required="yes" message="Please select a

    Language"  onChange="javascript:this.value=this.value.toUpperCase();" />

                </span></td>

                <td><span class="NormalText-TD">

                  <cfinput name="city" type="text" VALUE="#session.registration.city#" class="EGIT-txt" size="25" maxlength="100"required="yes" message="Please select a

    City"  onChange="javascript:this.value=this.value.toUpperCase();" />

                </span></td>

                <td> </td>

              </tr>

              <tr>

                <td> </td>

                <td> </td>

                <td> </td>

              </tr>

              <tr>

                <td><h3 class="head_grey_big"> <span>Parent / Guardian Details</span></h3></td>

                <td> </td>

                <td> </td>

              </tr>

              <tr>

                <td> </td>

                <td> </td>

                <td> </td>

              </tr>

              <tr>

                <td><span class="NormalText-TD">Name of Parent / Guardian / Next of Kin</span></td>

                <td><span class="NormalText-TD">Telephone Number  of Parent / Guardian / Next of Kin</span></td>

                <td><span class="NormalText-TD">Address of Parent / Guardian / Next of Kin</span></td>

              </tr>

              <tr>

                <td><span class="NormalText-TD">

                  <cfinput name="parentname" type="text" VALUE="#session.registration.parentname#" class="EGIT-txt" size="25" maxlength="100"required="yes" message="Please input your parent or Guardian name"  onChange="javascript:this.value=this.value.toUpperCase();" />

                </span></td>

                <td><span class="NormalText-TD">

                  <cfinput name="parenttel" type="text" VALUE="#session.registration.parenttel#" class="EGIT-txt" size="25" maxlength="100"required="yes" message="Please input your parent or Guardian Telephone"  />

                </span></td>

                <td><span class="NormalText-TD">

                  <cfinput type="text" name="parentadd" message="Please input your parent or Guardian address"required="yes" class="EGIT-txt" id="parentadd" VALUE="#session.registration.parentadd#" size="25" maxlength="100"  />

                </span></td>

              </tr>

              <tr>

                <td> </td>

                <td> </td>

                <td> </td>

              </tr>

              <tr>

                <td><span class="NormalText-TD">Email of Parent / Guardian / Next of Kin</span></td>

                <td><span class="NormalText-TD">Region of Parent / Guardian / Next of Kin</span></td>

                <td><span class="NormalText-TD">Country of Parent / Guardian / Next of Kin</span></td>

              </tr>

              <tr>

                <td><span class="NormalText-TD">

                  <cfinput type="text" name="parentemail"  class="EGIT-txt" id="parentemail"  onChange="javascript:this.value=this.value.toUpperCase();" VALUE="#session.registration.parentemail#" size="25" maxlength="100" />

                </span></td>

                <td><span class="NormalText-TD">

                  <cfinput type="text" name="parentreg" message="Please input your parent or Guardian Region "required="yes" class="EGIT-txt" id="parentemail2"  onChange="javascript:this.value=this.value.toUpperCase();" VALUE="#session.registration.parentreg#" size="25" maxlength="100" />

                </span></td>

                <td><cfselect    name="parentcountry" query="get_country" queryposition="below" value="name" display="name" selected="#session.registration.parentcountry#" required="yes" message="Please select the Parent

    Country">

                  <option value = "" >--Country--</option>

                </cfselect></td>

              </tr>

            </table></td>

          </tr>

        </table>

        <p> </p>

            <p> </p>

            <table width="300" border="0" align="right">

              <tr>

                <td> </td>

                <td> </td>

              </tr>

            </table>

    </cfcase>

    <!---Step Two :Educational Information--->

    <cfcase value="2">

      <h3 class="head_grey_big">Occupational Information</h3>

             <table width="850" border="0" class="Align-Right">

              <tr>

                <td width="1%" align="left" valign="top"> </td>

                <td width="99%">

                  <div align="left">

                    <table width="849" border="0" cellspacing="0" cellpadding="0">

                      <tr>

                        <td width="199">INSTITUTION </td>

                        <td width="179">PERIOD</td>

                        <td width="211">PRESENT GRADE </td>

                        <td width="260">BASIC QUALIFICATION</td>

                      </tr>

                      <tr>

                        <td><span class="NormalText-TD">

                          <cfinput type="text" name="institution01"  class="EGIT-txt" id="institution01" VALUE="#session.registration.institution01#" size="25" maxlength="100" />

                        </span></td>

                        <td><cfsilent>

            <cfquery name="get_years" datasource="#request.datasource#"  >

    SELECT  *  FROM years ORDER BY years

    </cfquery>

          </cfsilent>

          <cfselect    name="periodfrom1" id="periodfrom1" query="get_years" value="name" display="name" queryposition="below" selected="#session.registration.periodfrom1#">

            <option value="">From</option>

          </cfselect>

          <cfselect    name="periodto1" id="periodto1"  query="get_years" value="name" display="name" queryposition="below" selected="#session.registration.periodto1#">

            <option value="">To</option>

          </cfselect></td>

                        <td><span class="NormalText-TD">

                          <cfinput type="text" name="grade1"  class="EGIT-txt" id="institution" VALUE="#session.registration.grade1#" size="25" maxlength="50" />

                        </span></td>

                        <td><span class="NormalText-TD">

                          <cfinput type="text" name="basicq1"  class="EGIT-txt" id="basicq1" VALUE="#session.registration.basicq1#" size="25" maxlength="75" />

                        </span></td>

                      </tr>

                      <tr>

                        <td><span class="NormalText-TD">

                          <cfinput type="text" name="institution02"  class="EGIT-txt" id="institution02" VALUE="#session.registration.institution02#" size="25" maxlength="100" />

                        </span></td>

                        <td><cfselect    name="periodfrom2" id="periodfrom2"  query="get_years" value="name" display="name" queryposition="below" selected="#session.registration.periodfrom2#">

            <option value="">From</option>

          </cfselect>

          <cfselect    name="periodto2" id="periodto2"  query="get_years" value="name" display="name" queryposition="below" selected="#session.registration.periodto2#">

            <option value="">To</option>

          </cfselect></td>

                        <td><span class="NormalText-TD">

                          <cfinput type="text" name="grade2"  class="EGIT-txt" id="grade2" VALUE="#session.registration.grade2#" size="25" maxlength="50" />

                        </span></td>

                        <td><span class="NormalText-TD">

                          <cfinput type="text" name="basicq2"  class="EGIT-txt" id="basicq2" VALUE="#session.registration.basicq2#" size="25" maxlength="75" />

                        </span></td>

                      </tr>

                      <tr>

                        <td><span class="NormalText-TD">

                          <cfinput type="text" name="institution03"  class="EGIT-txt" id="institution03" VALUE="#session.registration.institution03#" size="25" maxlength="100" />

                        </span></td>

                        <td><cfselect    name="periodfrom3" id="periodfrom3"  query="get_years" value="name" display="name" queryposition="below" selected="#session.registration.periodfrom3#">

            <option value="">From</option>

          </cfselect>

          <cfselect    name="periodto3" id="periodto3"  query="get_years" value="name" display="name" queryposition="below" selected="#session.registration.periodto3#">

            <option value="">To</option>

          </cfselect></td>

                        <td><span class="NormalText-TD">

                          <cfinput type="text" name="grade3"  class="EGIT-txt" id="grade3" VALUE="#session.registration.grade3#" size="25" maxlength="50" />

                        </span></td>

                        <td><span class="NormalText-TD">

                          <cfinput type="text" name="basicq3"  class="EGIT-txt" id="basicq3" VALUE="#session.registration.basicq3#" size="25" maxlength="75" />

                        </span></td>

                      </tr>

                    </table>

                  </div></td>

      </tr>

            </table>

    </cfcase>

    <!---Step Three:Academic Information--->

    <cfcase value="3">

                   <!--- Set the datsources --->

             <cfset request.datasource="casper">

    <h3 class="head_grey_big">Academic Information</h3>

             <table width="850" border="0" class="Align-Right">

              <tr>

                <td width="5%" align="left" valign="top"> </td>

                <td width="95%">

                  <div align="justify">

                    <table width="820" border="0">

                      <tr>

                        <td width="22%" class="NormalText-TD">Program Type</td>

                        <td width="78%">

                        <cfsilent>

                          <cfquery name="getcatype" datasource="#request.datasource#">

                        SELECT CATYPEID, NAME

                        FROM CATYPE

                        ORDER BY NAME

                        </cfquery>

                          </cfsilent>

                          <cfselect name="catype" query="getcatype" display="name" value="CATYPEID" queryposition="below"  >

                            <option value="">---Program Type---</option>

                            </cfselect>

    </td>

                      </tr>

                      <tr>

                        <td> </td>

                        <td> </td>

                      </tr>

                      <tr>

                        <td class="NormalText-TD">Programme Level</td>

                        <td><cfselect name="sectornum"

                            queryposition="below"

                            bind="cfc:bservice.getsec({catype})"

                            display="NAME"

                            value="sectornum">

                            <option value="">---Programme Level---</option>

                        </cfselect></td>

                      </tr>

                      <tr>

                        <td> </td>

                        <td> </td>

                      </tr>

                      <tr>

                        <td class="NormalText-TD">Programme Name</td>

                        <td><cfselect name="ProgramID"

                               queryposition="below"

                               tooltip="PSCH"

                               bindAttribute="PSCH"

                            bind="cfc:pservice.getprogram({sectornum})"

                            display="pname"

                            value="PSCH"

                           selected="#session.registration.ptypeid#" >

                            <option value="">---Choice of School---</option>

                        </cfselect>

                        </td>

                      </tr>

                      <tr>

                        <td> </td>

                        <td> </td>

                      </tr>

                      <tr>

                        <td><span class="NormalText-TD">Choice of School</span></td>

                        <td>

                        <cfselect name="SCHNUM"

                            bind="cfc:dservice.getsch({ProgramID})"

                            display="name"

                            value="name"

                            queryposition="below"

                            selected="#session.registration.catid#" >

                            <option value="">---Programme Name---</option>

                        </cfselect></td>

                      </tr>

                    </table>

                    <h3> </h3>

                    </div></td>

              </tr>

            </table>

            </cfcase>

            <!---Step Four:Upload Information--->

    <cfcase value="4">

                   <!--- Set the datsources --->

             <cfset request.datasource="casper">

    <h3 class="head_grey_big">Working Experience</h3>

            <table width="820" border="0" align="center">

      <tr>

        <td width="351">Employer </td>

        <td width="459"><cfinput  type="text" name="employer" class="EGIT-txt" id="employer" 

    value="#session.registration.employer#" maxlength="50"/></td>

      </tr>

      <tr>

        <td> </td>

        <td> </td>

      </tr>

      <tr>

        <td>Period</td>

        <td><cfinput  type="text" name="employer_type" class="EGIT-txt" id="employer_type" 

    value="#session.registration.employer_type#" maxlength="50"/></td>

      </tr>

      <tr>

        <td> </td>

        <td> </td>

      </tr>

      <tr>

        <td>Position / Job</td>

        <td>

    <cfinput  type="text" name="job_title" class="EGIT-txt" id="job_title" 

    value="#session.registration.job_title#" maxlength="50"/></td>

      </tr>

      <tr>

        <td> </td>

        <td> </td>

      </tr>

    </table>

            <hr />

            <table width="820" border="0" align="center">

              <tr>

                <td width="351">Employer </td>

                <td width="459"><cfinput  type="text" name="employer1" class="EGIT-txt" id="employer2" 

    value="#session.registration.employer1#" maxlength="50"/></td>

              </tr>

              <tr>

                <td> </td>

                <td> </td>

              </tr>

              <tr>

                <td>Period</td>

                <td><cfinput  type="text" name="employer_type1" class="EGIT-txt" id="employer_type2" 

    value="#session.registration.employer_type1#" maxlength="50"/></td>

              </tr>

              <tr>

                <td> </td>

                <td> </td>

              </tr>

              <tr>

                <td>Position / Job</td>

                <td><cfinput  type="text" name="job_title1" class="EGIT-txt" id="job_title2" 

    value="#session.registration.job_title1#" maxlength="50"/></td>

              </tr>

              <tr>

                <td> </td>

                <td> </td>

              </tr>

            </table>

            <hr />

            <table width="820" border="0" align="center">

              <tr>

                <td width="351">Employer </td>

                <td width="459"><cfinput  type="text" name="employer2" class="EGIT-txt" id="employer3" 

    value="#session.registration.employer2#" maxlength="50"/></td>

              </tr>

              <tr>

                <td> </td>

                <td> </td>

              </tr>

              <tr>

                <td>Period</td>

                <td><cfinput  type="text" name="employer_type2" class="EGIT-txt" id="employer_type3" 

    value="#session.registration.employer_type2#" maxlength="50"/></td>

              </tr>

              <tr>

                <td> </td>

                <td> </td>

              </tr>

              <tr>

                <td>Position / Job</td>

                <td><cfinput  type="text" name="job_title2" class="EGIT-txt" id="job_title3" 

    value="#session.registration.job_title2#" maxlength="50"/></td>

              </tr>

              <tr>

                <td> </td>

                <td> </td>

              </tr>

            </table>

            <p> </p>

            <p> </p>

            </cfcase>

            <!---Step Five:Sumit Application--->

    <cfcase value="5">

                   <!--- Set the datsources --->

             <cfset request.datasource="casper">

    <h3 class="head_grey_big">Upload Photo & Submit Application</h3>

    <p> </p>

          <span class="error">You Have Successfully Completed The Basic Applicants Form, You may now Click On Finish To Upload A Picture Of Your Self.</span>

                   

            </cfcase>

         

      </cfswitch>     

      <p> </p></td>

                  <td width="20%">

                  <table cellpadding='0' cellspacing='0'>

                  <tr>

                  <td style='padding-right:0px;'>

      <h3 class='head-grey' style='padding-right:5px;'>

      Application Progress

      </h3><div><p>

      Complete the following steps to successfully apply for General positions.

    </p></div><ol class='steps'>

    <cfif #session.registration.stepNum# EQ 1 >

    <li  class='current' ><strong><a href="javascript:__doPostBack('','')">01   Personal Details</a></strong></li>

                <cfelse>

                <li><strong><a href="javascript:__doPostBack('','')">01   Personal Details</a></strong></li>

                </cfif>

    <cfif #session.registration.stepNum# EQ 2 >

    <li class='current'><strong><a  href="javascript:__doPostBack('','')">02   Education & Training</a></strong></li>

                <cfelse>

                <li><strong><a  href="javascript:__doPostBack('','')">02   Education & Training</a></strong></li>

                </cfif>

    <cfif #session.registration.stepNum# EQ 3 >

    <li class='current'><strong><a  href="javascript:__doPostBack('','')">03   Academic Information</a></strong></li>

                <cfelse>

                <li><strong><a  href="javascript:__doPostBack('','')">03   Academic Information</a></strong></li>

                </cfif>

                <cfif #session.registration.stepNum# EQ 4 >

    <li class='current'  ><strong><a  href="javascript:__doPostBack('','')">04   Working Experience</a></strong></li>

                <cfelse>

                <li><strong><a  href="javascript:__doPostBack('','')">04   Working Experience </a></strong></li>

    </cfif>

    <cfif #session.registration.stepNum# EQ 5 >

    <li class='current'  ><strong><a  href="javascript:__doPostBack('','')">05   Uploading Of Photo</a></strong></li></ol>

                <cfelse>

                <li><strong><a  href="javascript:__doPostBack('','')">05   Uploading Of Photo </a></strong></li></ol>

    </cfif>

      </td></tr></table></td>

                </tr>

              </table>

            

      <table width="300" border="0" align="right" class="Align-Right">

              <tr>

                <td>

                <!---Show Back Button unless at first step--->

      <cfif session.registration.StepNum GT 1>

      <input type="submit" name="goBack" class="proceed" value="&lt;&lt; Back">

        </cfif>

    <!---Show Next button Unless at last Step

    If at last step show Finish Button--->

    <cfif session.registration.stepNum LT numberofSteps>

    <input type="submit" name="goNext" class="proceed" value="Next &gt;&gt;">

    <cfelse>

    <input type="submit" name="goDone" class="proceed" value="Finish & Upload Photo ">

    </cfif></td>

                </tr>

            </table>

       </cfform>

    Submitted to NewApplicationWizard,cfm

    <cfquery name="dataoutput" datasource="#request.datasource#" >

    UPDATE  Users

    SET

    title_id   =  <cfqueryparam value="#session.registration.title#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    Firstname  =  <cfqueryparam value="#session.registration.firstname#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    Lastname   =  <cfqueryparam value="#session.registration.lastname#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    date    =  <cfqueryparam value="#session.registration.date#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    nationality = <cfqueryparam value="#session.registration.nationality#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    email = <cfqueryparam value="#session.registration.email#" cfsqltype="CF_SQL_VARCHAR"  />,

    Marital = <cfqueryparam value="#session.registration.marital#" cfsqltype="CF_SQL_VARCHAR"  />,

    gender = <cfqueryparam value="#session.registration.gender#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    country = <cfqueryparam value="#session.registration.country#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    region = <cfqueryparam value="#session.registration.region#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    address = <cfqueryparam value="#session.registration.address#" cfsqltype="CF_SQL_VARCHAR"  />,

    telephone = <cfqueryparam value="#session.registration.telephone#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    language = <cfqueryparam value="#session.registration.language#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    city = <cfqueryparam value="#session.registration.city#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    parentname = <cfqueryparam value="#session.registration.parentname#" cfsqltype="CF_SQL_VARCHAR"  />,

    parenttel = <cfqueryparam value="#session.registration.parenttel#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    parentadd = <cfqueryparam value="#session.registration.parentadd#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    parentemail = <cfqueryparam value="#session.registration.parentemail#" cfsqltype="CF_SQL_VARCHAR"  />,

    parentreg = <cfqueryparam value="#session.registration.parentreg#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    parentcountry   = <cfqueryparam value="#session.registration.parentcountry#" cfsqltype="CF_SQL_VARCHAR"  />,

    programme = <cfqueryparam value="#session.registration.ptypeid#" cfsqltype="CF_SQL_VARCHAR"  />,

    choice_of_school = <cfqueryparam value="#session.registration.catid#" cfsqltype="CF_SQL_VARCHAR"  />,

    institution01 = <cfqueryparam value="#session.registration.institution01#" cfsqltype="CF_SQL_VARCHAR"  />,

    institution02 = <cfqueryparam value="#session.registration.institution02#" cfsqltype="CF_SQL_VARCHAR"  />,

    institution03 = <cfqueryparam value="#session.registration.institution03#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    grade1 = <cfqueryparam value="#session.registration.grade1#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    grade2 = <cfqueryparam value="#session.registration.grade2#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    grade3 = <cfqueryparam value="#session.registration.grade3#" cfsqltype="CF_SQL_VARCHAR"  />,

    periodfrom01 = <cfqueryparam value="#session.registration.periodfrom1#" cfsqltype="CF_SQL_VARCHAR"  />,

    periodfrom02 = <cfqueryparam value="#session.registration.periodfrom2#" cfsqltype="CF_SQL_VARCHAR"  />,

    periodfrom03 = <cfqueryparam value="#session.registration.periodfrom3#" cfsqltype="CF_SQL_VARCHAR"  />,

    periodto01 = <cfqueryparam value="#session.registration.periodto1#" cfsqltype="CF_SQL_VARCHAR"  />,

    periodto02 = <cfqueryparam value="#session.registration.periodto2#" cfsqltype="CF_SQL_VARCHAR"  />,

    periodto03 = <cfqueryparam value="#session.registration.periodto3#" cfsqltype="CF_SQL_VARCHAR"  />,

    basic1 = <cfqueryparam value="#session.registration.basicq1#" cfsqltype="CF_SQL_VARCHAR"  />,

    basic2 = <cfqueryparam value="#session.registration.basicq2#" cfsqltype="CF_SQL_VARCHAR"  />,

    basic3     = <cfqueryparam value="#session.registration.basicq3#" cfsqltype="CF_SQL_VARCHAR"  />,  

    Employer   = <cfqueryparam value="#session.registration.Employer#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    Employer_type = <cfqueryparam value="#session.registration.Employer_type#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    job_title = <cfqueryparam value="#session.registration.job_title#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    Employer1 = <cfqueryparam value="#session.registration.Employer1#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    Employer_type1 = <cfqueryparam value="#session.registration.Employer_type1#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    job_title1 = <cfqueryparam value="#session.registration.job_title1#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    Employer2 =  <cfqueryparam value="#session.registration.Employer2#" cfsqltype="CF_SQL_VARCHAR"  />,

    Employer_type2 = <cfqueryparam value="#session.registration.Employer_type2#" cfsqltype="CF_SQL_VARCHAR"  /> ,

    job_title2      =  <cfqueryparam value="#session.registration.job_title2#" cfsqltype="CF_SQL_VARCHAR"  />

    WHERE Username = <cfqueryparam value="#Session.User.username#" cfsqltype="CF_SQL_VARCHAR"  />

    </cfquery>

    talofer99
    Inspiring
    March 27, 2011

    Quick q' is the "sessionManagement" activated on your application.cfm/cfc ?

    If not you will not be getting the session scope ….