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

How do I create a "forgot password" and "forgot username" Form?

New Here ,
Feb 07, 2010 Feb 07, 2010

Copy link to clipboard

Copied

Good Day,

I am in need of assistance in learning how to create a "forgot password" and "forgot username" form in DW CS4.  I have researched Adobe and the Internet and I am coming somewhat empty on tutorials or step-by-step instructions.

I would appreciate any step-by-step instructions, a link to a good online tutorial, or any other related source that can help me get from beginning to end.

Thank you.

TOPICS
Server side applications

Views

5.9K

Translate

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 ,
Feb 08, 2010 Feb 08, 2010

Copy link to clipboard

Copied

Mofrader wrote:

I am in need of assistance in learning how to create a "forgot password" and "forgot username" form in DW CS4.  I have researched Adobe and the Internet and I am coming somewhat empty on tutorials or step-by-step instructions

It's good that you have done some research. Unfortunately, I can't suggest any quick or easy solution.

Basically, what you need is an online form that gathers details that identify the user, looks up the details in your database, and sends an email as a reply. Setting that up is relatively easy if you are familiar with building forms, searching a database, and sending emails. What makes it less straightforward is building in the necessary security to ensure that you don't reveal details to the wrong person. In fact, you shouldn't be storing unencrypted passwords, so it's better to create a system that regenerates a new password.

Since you're asking for step by step instructions, it sounds as though you're new to server-side development. There's a lot to it. Get familiar with the basics first, and then you can start putting things together to create the sort of applications you want.

Votes

Translate

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
New Here ,
Feb 08, 2010 Feb 08, 2010

Copy link to clipboard

Copied

Thank you for your post.

You're right.  I am relatively new to server-side development; however, I have experience with the following:

  • Setting up an sql database and tables
  • Connecting to an sql database in DW, using binding features (recordsets), and server-side behaviors (inserting records, user authentication)
  • creating forms and inserting server behavior (insert record)
  • Creating a login and log out page
  • working with SSL function

When I went online to learn how to create a "forgot password" form, I learned that Adobe had developer assistance extensions for DW to assist with that, but learned they discontinued it and are no longer providing support.

At this time, I already have my login and registration page created and connected to a record (dynamically).  I have tested it using Apache and everything seems to work well.  The login form is directing me to the assigned page.  The registration form is directing me to the assigned page.

Do you feel I am ready to learn how insert the necessary dynamic functions for my users to obtain their password, user name (email address), as well as create an email to send out the user the required information?

Thank you.

Votes

Translate

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 ,
Feb 09, 2010 Feb 09, 2010

Copy link to clipboard

Copied

If you have experience of building forms and working with recordsets, you should be able to create the system you want. However, I'm not aware of any online tutorials that will step you through the process. "Practical Web 2.0 Applications with PHP" by Quentin Zervaas does have a section that deals with reissuing passwords. Unfortunately, the book deals with building a complex application that uses the Zend Framework and Smarty, so even if you went out and bought it, I doubt whether you would find it very helpful.

Just to give you an idea of the amount of work involved, Quentin Zervaas devotes 9 pages to it. The book is aimed at the advanced level, so he doesn't go through it step by step. However, it's not a particularly complex process. You create a form that checks the user's credentials in some way, such as asking for the registered email address. If the email address is in your database, you generate a new password for the user and send it to the email address.

Votes

Translate

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
Explorer ,
Sep 21, 2011 Sep 21, 2011

Copy link to clipboard

Copied

Hope this work for you...

What kind of web programming do you use for? If you use PHP MySQL, you can do it easily.

For example I use a MySQL Table called "admin":

CREATE TABLE IF NOT EXISTS `admin` (

  `id` int(10) NOT NULL AUTO_INCREMENT,

  `name` varchar(64) NOT NULL,

  `email` varchar(64) NOT NULL,

  `username` varchar(64) NOT NULL,

  `password` varchar(64) NOT NULL,

  `activation` varchar(64) NOT NULL,

  `level` int(2) NOT NULL DEFAULT '0',

  `date_registered` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

  PRIMARY KEY (`id`)

) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

INSERT INTO `admin` (`id`, `name`, `email`, `username`, `password`, `activation`, `level`, `date_registered`) VALUES

(1, 'Andoyo', 'andoyoandoyo@gmail.com', 'andoyo', 'andoyo', '8e67d638c0d130a4d66b2888ffc8335b', 0, '2011-09-21 10:32:16');

Make two files, they are:

  1. forgot_password.php, contain form and php mail function
  2. error.php, a redirect page if the mail function doesn't work.

And then, use your Dreamweaver to make a recordset, called: rsForgotPassword

  1. Click Insert > Data Objects > Recordset
  2. Name: rsForgotPassword
  3. Connection: adobe_cookbooks
  4. Table: admin
  5. Columns: All
  6. Filter: email, Form variable, =, email. Use form variable to pass the value from the form.
  7. Click OK

Use if function to make the forgot function work perfectly, for example:

  1. If the email is entered correctly, the mail script will run
  2. If the email doesn't exist in the database, the notification will come out
  3. If they open the page directly, they have to type any keyword

Final example:

forgot_password.php

<?php require_once('Connections/adobe_cookbooks.php'); ?>

<?php

if (!function_exists("GetSQLValueString")) {

function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

{

  if (PHP_VERSION < 6) {

    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {

    case "text":

      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

      break;  

    case "long":

    case "int":

      $theValue = ($theValue != "") ? intval($theValue) : "NULL";

      break;

    case "double":

      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";

      break;

    case "date":

      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

      break;

    case "defined":

      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;

      break;

  }

  return $theValue;

}

}

$colname_rsForgotPassword = "-1";

if (isset($_POST['email'])) {

  $colname_rsForgotPassword = $_POST['email'];

}

mysql_select_db($database_adobe_cookbooks, $adobe_cookbooks);

$query_rsForgotPassword = sprintf("SELECT * FROM `admin` WHERE email = %s", GetSQLValueString($colname_rsForgotPassword, "text"));

$rsForgotPassword = mysql_query($query_rsForgotPassword, $adobe_cookbooks) or die(mysql_error());

$row_rsForgotPassword = mysql_fetch_assoc($rsForgotPassword);

$totalRows_rsForgotPassword = mysql_num_rows($rsForgotPassword);

?>

<!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>Untitled Document</title>

</head>

<body>

<p>Forgot your password:</p>

<?php if (isset($_POST['email']) && ($row_rsForgotPassword['email']=="")) {

  $colname_rsForgotPassword = $_POST['email']; ?>

<p>Email doesn't exist in our database</p>

  <?php }elseif (isset($_POST['email'])) {

  $colname_rsForgotPassword = $_POST['email'];

  $username = $row_rsForgotPassword['username'];

$password =$row_rsForgotPassword['password'];

$to = $row_rsForgotPassword['email'];

// Mai function

$subject = "Your username dan password: ".$row_rsForgotPassword['name'];

$body = "<html><body>" .

                    "<h2>Thank you...</h2>" .

                    "<p>This is your username and password:</p>".

                    "<ul><li>Username=".$username."</li>".

                    "<li>Password= ".$password."".

                    "From: Webmaster www.javawebmedia.com";

$headers =           "From: Webmaster www.javawebmedia.com <contact@javawebmedia.com>\r\n" .

                              "MIME-Version: 1.0\r\n" .

                              "Content-type: text/html; charset=UTF-8";

if (!mail($to, $subject, $body, $headers)) {

          $redirect_error= "error.php"; // Redirect if there is an error.

  header( "Location: ".$redirect_error ) ;

}

  ?>

  <p>Thank you, your username and password has been sent to your email.</p>

  <?php }else{ ?>

  <p>Please type any keyword.</p>

  <?php } ?>

<form id="form1" name="form1" method="post" action="">

  <p>

    <label for="email">Your email:</label>

    <input type="text" name="email" id="email" />

    <input type="submit" name="Submit" id="submit" value="Submit" />

    <input type="reset" name="Reset" id="submit2" value="Reset" />

  </p>

  <p>The username and password will be sent to your email.</p>

</form>

<p></p>

</body>

</html>

<?php

mysql_free_result($rsForgotPassword);

?>

error.php

<!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>Untitled Document</title>

</head>

<body>

Oops, error page.

</body>

</html>

Votes

Translate

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
Engaged ,
Jan 08, 2013 Jan 08, 2013

Copy link to clipboard

Copied

should the text be viewable with regards to

Forgot your password:

Email doesn't exist in our database

Thank you, your username and password has been sent to your email.

Please type any keyword

or should they have php wrapped around it part

Votes

Translate

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
New Here ,
Jan 20, 2023 Jan 20, 2023

Copy link to clipboard

Copied

Hello ,

Can you help me to convert this script for aspvb, i am using a access data base and odbc connection windows server

my email address:

i will reimburse you for your help.

Thank you

G.

 

[Moderator Note: Do not post personal information in the forum. Email address removed. You've resurrected a post from 2010, locking it down.]

Votes

Translate

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
Community Expert ,
Jan 20, 2023 Jan 20, 2023

Copy link to clipboard

Copied

LATEST
quote

Hello ,

Can you help me to convert this script for aspvb, i am using a access data base and odbc connection windows server

my email address:

i will reimburse you for your help.

Thank you

G.

 

[Moderator Note: Do not post personal information in the forum. Email address removed. You've resurrected a post from 2010, locking it down.]


By @ghivas

=======

No and no.  Those technologies are not supported by Dreamweaver.  And this is not a job site.  If you have a job to fill, post your ad on Behance/Adobe Talent.

https://www.behance.net/joblist

 

 

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

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