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

CS3 Login behavior

LEGEND ,
Jan 18, 2008 Jan 18, 2008

Copy link to clipboard

Copied

I am using the Log in User server behavior and would like to show an
error message if the logging in fails.
So I changed the code into that:

if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
$errorinfo = "Wrong username or password";
}

and above the form I have that:

<?php if ($errorinfo !='') {?>
<?php echo $errorinfo; ?>
<?php }; ?>

This works - but in the server behavior panel I find two entries for the
Log in behavior and I've got an alert that Dreamweaver cannot differ
between the "two behaviors", although there is only one.

Is there something wrong with my code?

Leolux
TOPICS
Server side applications

Views

248
Translate

Report

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
LEGEND ,
Jan 18, 2008 Jan 18, 2008

Copy link to clipboard

Copied

Leolux wrote:
> This works - but in the server behavior panel I find two entries for the
> Log in behavior and I've got an alert that Dreamweaver cannot differ
> between the "two behaviors", although there is only one.
>
> Is there something wrong with my code?

No, but by changing the code of a Dreamweaver server behavior, DW can no
longer recognize it, so it displays the error message.

Get rid of what you have at the moment. Apply the login user server
behavior again, and select the login page as the page to go to when the
login fails. Assuming it's called login.php, use this as the value:

login.php?fail=true

Insert this in the body of the page:

<?php if (isset($_GET['fail'])) {
echo '<p>Wrong username or password</p>';
}
?>

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

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
LEGEND ,
Jan 18, 2008 Jan 18, 2008

Copy link to clipboard

Copied

LATEST
David Powers wrote:

> Get rid of what you have at the moment. Apply the login user server
> behavior again, and select the login page as the page to go to when the
> login fails. Assuming it's called login.php, use this as the value:
>
> login.php?fail=true
>
> Insert this in the body of the page:
>
> <?php if (isset($_GET['fail'])) {
> echo '<p>Wrong username or password</p>';
> }
> ?>

Great - that works fine. Thank you!

Leolux

Votes

Translate

Report

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