Solved

Need incorrect password to bring back error message in sign in

Posted on 2007-11-15
2
146 Views
Last Modified: 2013-12-24
I have a log-in header and need to create some feedback for failed log-ins. I tried an <cfif> statement based on the url //   <cfif URL EQ "#CGI.SCRIPT_NAME#?e=1%">
                        <tr>Log-in failed Try again</tr></cfif>  //

But got an error

What is the best syntax to use to display feedback on a failed log-in attempt?

<div class="login tab_show" id="logindiv">

	<cfif not isDefined("session.idaccount") or not isDefined("session.username")>

		<cfform action="/includes/login-process.cfm" method="post" name="login" class="login">

			<table cellpadding="0" cellspacing="0">

				<tr>

					<th nowrap="nowrap">

						LOG IN

					</th>

					<td>

						<cfinput type="text" name="username" value="" style="margin-right:25px;">

					</td>

					<th>

						PASSWORD

					</th>

					<td>

						<cfinput type="password" name="password" value="" style="width:75px;">

					</td>

					<td style="padding-left:3px;">

						<cfinput type="submit" name="submit" value="GO" class="btn">

					</td>

                   

					

				</tr>

              <!--- ' <cfif URL EQ "#CGI.SCRIPT_NAME#?e=1%">

'				<tr>Log-In failed TRy again</tr></cfif>tr>--->

			</table>

		</cfform>

	<cfelse>

	<div class="loggedin">Logged in as <cfoutput>#session.username#</cfoutput> | &nbsp; <a href="/logout.cfm">logout</a></div>

	</cfif>

</div>
 

<div class="login tab_hide" id="searchdiv">

		<cfform action="/search-results.cfm" method="post" name="login" class="login">

			<table cellpadding="0" cellspacing="0">

				<tr>

					<th nowrap="nowrap">

						FIRST NAME

					</th>

					<td>

						<cfinput type="text" name="firstname" value="" style="margin-right:10px;">

					</td>

					<th nowrap="nowrap">

						LAST NAME

					</th>

					<td>

						<cfinput type="text" name="lastname" value="" style="width:75px;">

					</td>

					<td style="padding-left:3px;">

						<cfinput type="submit" name="submit" value="GO" class="btn">

					</td>

				</tr>

			</table>

		</cfform>

</div>

Open in new window

0
Comment
Question by:patGRFXS
  • 2
2 Comments
 
LVL 52

Expert Comment

by:_agx_
ID: 20290746
> <cfif URL EQ "#CGI.SCRIPT_NAME#?e=1%">

To test the existence of a url parameter named "e" use either IsDefined or structKeyExists

<cfif structKeyExists(url, "yourParameterName")>
      Error parameter found. show error message
</cfif>

<cfif IsDefined("ulr.yourParameterName")>
      Error parameter found. show error message
</cfif>
0
 
LVL 52

Accepted Solution

by:
_agx_ earned 125 total points
ID: 20290785
Typo correction below

> <cfif URL EQ "#CGI.SCRIPT_NAME#?e=1%">

URL is a complex object (ie structure) and cannot be use in that type of equality comparison.  So test a simple value like your url parameter:  "e" .  Test whether the parameter exists and/or test its value.


<cfif structKeyExists(url, "yourParameterName")>

      Error parameter found. show error message

</cfif>
 

<cfif IsDefined("URL.yourParameterName")>

      Error parameter found. show error message

</cfif>

Open in new window

0

Featured Post

Network it in WD Red

There's an industry-leading WD Red drive for every compatible NAS system to help fulfill your data storage needs. With drives up to 8TB, WD Red offers a wide array of solutions for customers looking to build the biggest, best-performing NAS storage solution.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Application launch issue with Apache Tomcat 5 19
wordpress limitations 4 103
Search on a site 5 92
free scanner TWAIN can be operated with a Web application 9 37
Foreword (May 2015) This web page has appeared at Google.  It's definitely worth considering! https://www.google.com/about/careers/students/guide-to-technical-development.html How to Know You are Making a Difference at EE In August, 2013, one …
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now