Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Help! Form is not submitting or doing anything! Any ideas?

Guest
Jan 18, 2012 Jan 18, 2012

I inherited this web application and have zero CF experience and any help is greatly appreciated!  So, the "Forgot Password" form isn't working at all.  The email is sent properly from the referring page and when you click the link it brings up the page right, however, when you fill out the form with "email address" and "username" and hit submit, it does nothing.  I'm not even getting an error.

Is there something I'm missing in the code that is wrong?  I'll post the entire code and what the URL looks like when arriving at this page.  It is still in my dev environment.

Thanks in advance for ANY help!  I'm really lost and confused.

http://<server>/~mld/ForgotPassword/index.cfm?plw=359&qke=995708

<!---

Project: MLD Registry

Page Name: index.cfm

Page Purpose: Home page for Forgot Password pages

Programmer: Eric Savage

--->

<html>

<head>

          <title>Forgot Password</title>

          <link rel="stylesheet" type="text/css" media="screen" href="../StyleSheet_Display.css" />

          <link rel="stylesheet" type="text/css" media="print" href="../StyleSheet_Print.css" />

</head>

<body>

<cfsilent>

<cfparam name="plw" default=""><!--- Registry_ID --->

<cfparam name="qke" default=""><!--- Acct_num_temp --->

<cfparam name="Email" default="">

<cfparam name="UserName" default=""><!--- User Name --->

<cfparam name="CheckEntries" default=""><!--- Check submissions for errors --->

<cfparam name="Error" default="0">

<cfparam name="ErrorMessage_Email" default="">

<cfparam name="ErrorMessage_UserName" default="">

<cfparam name="ksr" default=""><!--- Forgot password: email/new password sent --->

<cfparam name="uca" default="">

<cfif Len(CheckEntries) and Len(UserName) and Len(Email) and Len(plw) and Len(qke)>

          <cftry>

    <cfquery name="CheckIfValidUser" datasource="#Datasource#">

        SELECT                    rid,rid_name,r_email,registry_id,acct_num_temp,r_website_type

        FROM                    registry

        WHERE                    rid_name= <cfqueryparam value="#UserName#" cfsqltype="CF_SQL_VARCHAR"> and r_email= <cfqueryparam value="#Email#" cfsqltype="CF_SQL_VARCHAR"> and registry_id= #plw# and acct_num_temp= #qke#

    </cfquery>

    <cfcatch type="Any">

                    <cfinclude template="../includefiles/inc_EmailWebsiteManager.cfm">

              <cflocation url="ErrorMessage.cfm" addtoken="No">

        <cfabort>

    </cfcatch>

          </cftry>

          <cfif not CheckIfValidUser.RecordCount>

                    <cftry>

                    <cfquery name="UserLog" datasource="#Datasource#">

                              INSERT INTO userlog(http_user_agent,todaysdate,ip_address,user_name,comments)

                              VALUES ('#CGI.http_user_agent#',#CreateODBCDateTime(Now())#,'#remote_addr#','#Email#','ForgotPassword/index.cfm: failed attempt')

                    </cfquery>

                    <cfcatch type="Any">

                              <cfinclude template="../includefiles/inc_EmailWebsiteManager.cfm">

                    </cfcatch>

                    </cftry>

          </cfif>

          <cfif CheckIfValidUser.RecordCount>

                    <cfinclude template="../includefiles/inc_Password_CreateRandom.cfm"><!--- Creates random password in variable called RandomlyCreated_Password --->

       

        <cfset Password_To_Check= RandomlyCreated_Password><!--- Pass value of new password to include file --->

                    <cfinclude template="../includefiles/inc_Password_CheckFormat.cfm"><!--- Check password complies with  --->

                    <cfif Len(ErrorMessage_Password_To_Check)>

                  <cfset ErrorMessage= "(" & #CheckIfValidUser.rid# & ") [auto password gen] " &  ErrorMessage_Password_To_Check>

            <cfinclude template="../includefiles/inc_EmailWebsiteManager.cfm">

            <cflocation url="ErrorMessage.cfm" addtoken="No">

            <cfabort>

                    </cfif>

       

                    <cfif not Len(ErrorMessage_Password_To_Check)>

            <cftry>

            <cfquery name="UpdatePassword" datasource="#Datasource#">

                UPDATE                    registry

                SET                              rid_pass= Password('#RandomlyCreated_Password#')

                WHERE                    rid_name= <cfqueryparam value="#UserName#" cfsqltype="CF_SQL_VARCHAR"> and r_email= <cfqueryparam value="#Email#" cfsqltype="CF_SQL_VARCHAR"> and registry_id= #plw# and acct_num_temp= #qke#

            </cfquery>

            <cfcatch type="Any">

                <cfinclude template="../includefiles/inc_EmailWebsiteManager.cfm">

                <cflocation url="ErrorMessage.cfm" addtoken="No">

                <cfabort>

            </cfcatch>

            </cftry>

            <cftry>

            <cfquery name="UserLog" datasource="#Datasource#">

                INSERT INTO userlog(http_user_agent,todaysdate,ip_address,user,comments)

                VALUES ('#CGI.http_user_agent#',#CreateODBCDateTime(Now())#,'#remote_addr#','#CheckIfValidUser.rid#','ForgotPassword/index.cfm: new password added')

            </cfquery>

            <cfcatch type="Any">

                <cfinclude template="../includefiles/inc_EmailWebsiteManager.cfm">

            </cfcatch>

            </cftry>

            <cfparam name="Subject" default="(Secure) NDRD Clinical Questionnaire">

            <cfif CheckIfValidUser.r_website_type is "MLD"><cfset Subject= "(Secure) MLD Registry"></cfif>

            <cfif CheckIfValidUser.r_website_type is "NFRD"><cfset Subject= "(Secure) NFRD Registry for Rare Genetic Disorders"></cfif>

            <cftry>

            <cfmail

                to="#Email#"

                subject="#Subject#"

                from="#CONTACT.EMAIL_NURSE#"

                server="<SMTP SERVER>"

                type="html">

                <p>Here is the new password you requested: #RandomlyCreated_Password#.</p>

            </cfmail>

            <cfcatch type="Any">

                <cfinclude template="../includefiles/inc_EmailWebsiteManager.cfm">

                <cflocation url="ErrorMessage.cfm" addtoken="No">

                <cfabort>

            </cfcatch>

            </cftry>

           

            <cfparam name="WebsiteType" default="">

            <cfif CheckIfValidUser.r_website_type is "Clinic"><cfset WebsiteType= "01345"></cfif>

            <cfif CheckIfValidUser.r_website_type is "MLD"><cfset WebsiteType= "04385"></cfif>

            <cfif CheckIfValidUser.r_website_type is "NFRD"><cfset WebsiteType= "03475"></cfif>

   

            <cflocation url="index.cfm?ksr=30471&dfa=84836&uca=#WebsiteType#" addtoken="No">

        </cfif>

          </cfif>

</cfif>

</cfsilent>

<cfinclude template="inc_PageTitle.cfm"><!--- Page title --->

<div id="Container">

          <cfinclude template="inc_NavBar.cfm">

          <div id="Content">

                    <div id="minheight">

                              <cfoutput>

                              <cfif not Len(ksr)>

                                        <div style="padding: .5em 0 .75em 0; border-style: solid; border-width: 0 0 1px 0;">

                    Please enter your email address and user name.

                                        </div>

                                        <cfform action="index.cfm" method="POST">

                                                  <p>

                                                  <span class="ResponseLabel_10"><label for="Email">Email Address</label></span>

                                                  <cfinput type="Text" name="Email" id="Email" value="#Email#" message="Please enter an email address" required="Yes" size="30" maxlength="40">

                                                  </p>

                                                  <p>

                                                  <span class="ResponseLabel_10">User Name</span>

                                                  <cfinput type="Text" name="UserName" id="UserName" value="#UserName#" message="Please enter a User Name" required="Yes" size="12" maxlength="50">

                                                  </p>

                                                  <p><input type="submit" value="Submit"></p>

                                                  <input type="hidden" name="CheckEntries" value="Check">

                    <cfoutput>

                                                  <input type="hidden" name="plw" value="#plw#"><!--- Registry_ID --->

                                                   <input type="hidden" name="qke" value="#qke#"><!--- Acct_num_temp --->

                    </cfoutput>

                                        </cfform>

                              </cfif>

                              <cfif Len(ksr)>

                                        <cfif Trim(uca) is "01345"><cfset WebsiteType= "Clinic"></cfif>

                <cfif Trim(uca) is "04385"><cfset WebsiteType= "MLD"></cfif>

                <cfif Trim(uca) is "03475"><cfset WebsiteType= "NFRD"></cfif>

                                        <div style="padding: .5em 0 .75em 0;">An email has been sent with your new password.</div>

               

                <cfif Len(Trim(WebsiteType))><a href="#HTMLPath#/#WebsiteType#/LogIn.cfm">Log in</a></cfif>

                              </cfif>

                              </cfoutput>

                    </div><!--- min-height --->

          </div><!--- Content --->

</div><!--- Containter --->

<cfinclude template="../includefiles/inc_PageFooter.cfm"><!--- Page footer (contains closing tag for Container) --->


2.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jan 18, 2012 Jan 18, 2012

<cfform action="index.cfm" method="POST">

This line is going to tell the web browser to submitt the page to the web server and have the web server run the "index.cfm" page.

The web server then expects the "index.cfm" page to expect a post request and do something with the key-value pairs contained in the header of the request.

With a rather generaic file name like "index.cfm" it is not unlikely that the index.cfm page simply ignores the form key-value pairs and does nothing with them.  But with no way to see the server side code of this index.cfm page I can not tell for sure.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 18, 2012 Jan 18, 2012

Thanks so much for responding...if there is any other files you need let me know.  Or where I can stick some comments in for debug let me know.  I'm not sure if there is a PM function here but I'd be happy to give you my email address if you can PM me.  Thanks again!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jan 18, 2012 Jan 18, 2012

THen the place to start is to put <cfdump var="#form#"> at the top of the page and run through the process and make sure you are getting expected results.

From there, work through the process one step at a time until you find out where your are not getting the expected results and hopefully WHY you are not getting the expected results.

The places to check first are the form values and then the query resutls generated using the form values.

Let us know if you need more explict help.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 18, 2012 Jan 18, 2012

really and truly, thanks!!  I appreciate your time more than I can ever express.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 18, 2012 Jan 18, 2012
LATEST

Thank you so much!  It is working...that bit of code helped tremendously.  So, I have my email address listed multiple times and it was going to the last record.  I can't express enough my gratitude for your time!

I hope to repay it sometime.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 18, 2012 Jan 18, 2012

so the code i posted was /ForgotPassword/index.cfm...so it was submitting to itself.  sorry

I hope this helps.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources