close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Adding Login Failed Message

Thread began 9/20/2010 8:07 am by Martin | Last modified 5/02/2011 9:35 am by Martin | 17417 views | 20 replies |

Martin

Adding Login Failed Message

Greetings,

I was wondering if there was a way with Power CMS to provide the end user with more feedback than appending the URL with "failed=1&" to let users know that they have entered their password incorrectly?

If so, how would you add a conditional message to the page such as

"Your Login Was Unsuccessful - Please Try Again"

or

"forgot your password? Contact your Super Admin to reset"

Something like this?

Thanks for any help!

Martin

Sign in to reply to this post

Jason ByrnesWebAssist

you can use the querystring to trigger a message using an if statement:

php:
<?php if(isset($_GET['failed']) && $_GET['failed'] == "1") { ?>

Your Login Was Unsuccessful - Please Try Again
<?php ?>
Sign in to reply to this post

Martin

AWESOME! That worked great!

Thanks
Martin

Sign in to reply to this post

Jason ByrnesWebAssist

Great, glad to hear it's working.

Sign in to reply to this post

PaulBeta Tester

Can you expand please

Originally Said By: Jason Byrnes
  you can use the querystring to trigger a message using an if statement:
php:
<?php if(isset($_GET['failed']) && $_GET['failed'] == "1") { ?>

Your Login Was Unsuccessful - Please Try Again
<?php ?>
  



How might this be applied in a login page where an email input, password imput and submit button exist??

Thankyou, Paul.

Sign in to reply to this post

Jason ByrnesWebAssist

in the login behavior, set the failed redirect to go back to itself with the failed=1 querystring variable.


for example if my login page is "login.php" I set the failed redirect in the login behavior as:

login.php?failed=1


then use the code form my previous reply to show the message.

Sign in to reply to this post

PaulBeta Tester

Got it. Sorted!

Thank you.

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post

Martin

An example

Greetings,

here is some example code of how I used this...

<?php if(isset($_GET['failed']) && $_GET['failed'] == "1") { ?>
<h2 class="center" style="color: #red; margin-top: 20px;"><span style="font-weight: bold;"><em>Your Login Was Unsuccessful - Please Try Again</em></span><em>!</em><br />
or contact your <a href="mailto:youremail@yourdomain.com?subject=Client%20Name%20Admin%20Forgot%20Password%20Request">Super Admin</a> to recover your password.</h2>
<?php } ?>

I put this just below the form on the login page and made sure the form action was as follows.

action="users_login.php?failed=1<?php echo(isset($_SERVER["QUERY_STRING"])?"&".($_SERVER["QUERY_STRING"]):""); ?>"

I hope this helps!

Martin

Sign in to reply to this post

Jason ByrnesWebAssist

Martin, you dont want to include the failed=1 querystring in the forms action.

you only want to include the failed=1 querystring in the failed redirect of the Authenticate User server behavior.

double click the authenticate user server behavior and set the failed redirect to:
users_login.php?failed=1

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...