Question about reset password in lesson08 of David Powers (Dreamweaver CS5 with PHP)

I'm at the page 299 that found a problem in reset password. I managed to received email of link to reset password. In the reset password form, why no checking of password length entered or password unmatch with confirmed password input ? Instead it displays error message of 'Sorry, there was an error. Make sure you used the complete URL in the email you received. The URL can be used to change your password only once. If necessary...' The error message of 'Passwords don't match' or 'Use 8-15 letters or numbers only' not processed.
Please help !
Thank You

I can see the 32 characters attached to URL and also I can see the 32 characters stored in database. It actually can reset the the password if entered within the requirement of 8-15. But when I entered less than 8, it does not show the error message of 'Use 8-15 letters or numbers only'.
I noticed that $_SESSION['nomatch'] was assigned to True after the validation of 8-15 length. Below is the code for reference.
<?php
session_start();
$errors = array();
$success = FALSE;
$_SESSION['nomatch'] = TRUE;
require_once('library.php');
try {
  if (isset($_GET['id']) && isset($_GET['token'])) {
          $id = $dbRead->quote($_GET['id']);
          $token = $dbRead->quote($_GET['token']);
          $sql = "SELECT user_id FROM users WHERE user_id = $id AND token = $token";
          $result = $dbRead->fetchRow($sql);
          if ($result) {
      $_SESSION['user_id'] = $_GET['id'];
            $_SESSION['token'] = $_GET['token'];
            $_SESSION['nomatch'] = FALSE;
  if (isset($_POST['reset'])) {
          // password reset code goes here
          $val = new Zend_Validate();
          $val->addValidator(new Zend_Validate_StringLength(8,15));
          $val->addValidator(new Zend_Validate_Alnum());
          if (!$val->isValid($_POST['password'])) {
            $errors['password'] = 'Use 8-15 letters or numbers only';
          $val = new Zend_Validate_Identical($_POST['password']);
          if (!$val->isValid($_POST['conf_password'])) {
            $errors['conf_password'] = "Passwords don't match";
          if (!$errors) {
            // update the password
            $data = array('password' => sha1($_POST['password']),
                          'token'    => NULL);
            $where['user_id = ?'] = $_SESSION['user_id'];
            $where['token = ?'] = $_SESSION['token'];
            $success = $dbWrite->update('users', $data, $where);
            unset($_SESSION['user_id']);
            unset($_SESSION['token']);
            unset($_SESSION['nomatch']);
} catch (Exception $e) {
  echo $e->getMessage();

Similar Messages

  • David Powers Dreamweaver CS5 with PHP training from the source mail connector problem

    Hello,
    first I will say great work david this is great book, and i found everything i neede in it.
    I have one problem.
    I have managed to get to lesson 8 and i couldnt wait so i started live project and incororated everything in it learned from this book.
    But this is the problem.
    I have hosting on bluehost which makes mail conector from lessons 7-8 with gmail not to send email in example when i try to recover forgoten password.
    The scripts changes the token in database in users table, token is created, and i get message that the mail was sent but nothing comes to my mail.
    Same password login and everything works local but on bluehost server  wont send mail.
    I contacted them and they said that i have to create mail on server from which mail will be sent.
    I did that too.
    But for what ever i put in mailconector array cant get that mail, and i really dont know what to do and who to ask.
    Until this point i could get every problem solved put this bugs me because this is the last stage of what i was tryong to do and that is to incorporate login system from the book to live page.
    this is the code i have:
    <?php
    $mailhost='ssl://mail.majapanic-tarot.com';
    $mailconfig=array(    'auth'         =>     'true',
                        'username'     =>     '[email protected]',
                        'password'     =>     'password',
                        'ssl'        =>    'ssl',
                        'port'        =>     '465');
    $transport=new Zend_Mail_Transport_Smtp($mailhost,$mailconfig);
    Zend_Mail::setDefaultTransport($transport);
    and this is what they stated in info about the mail:
    Mail Server Username: majapanic+majapanic-tarot.com  >>>>>>>> this plus i think is (at)
    Incoming Mail Server: mail.majapanic-tarot.com
    Incoming Mail Server: (SSL) box344.bluehost.com
    Outgoing Mail Server: mail.majapanic-tarot.com (server requires authentication) port 26
    Outgoing Mail Server: (SSL) mail.majapanic-tarot.com (server requires authentication) port 465
    Supported Incoming Mail Protocols: POP3, POP3S (SSL/TLS), IMAP, IMAPS (SSL/TLS)
    Supported Outgoing Mail Protocols: SMTP, SMTPS (SSL/TLS)
    Please HELP!

    FIXED!!
    1)
    i finally did get the message problem was with:
    $mailhost='ssl://mail.domain.com';
    ssl:// was just nonsense and been removed
    2)
    'auth' => 'true' was changed to 'auth' => 'login'
    3)
    for bluehost i got information that it was tls secure connection protocol not ssl
    'ssl' => 'tls'
    4)
    port used '25' not 465.
    Didnt still tried 26 and 465 maybe they would work too.

  • DW CS5 with PHP - book question

    Hello,
    I'm working my way through the book "Dreamweaver CS5 with PHP" by David Powers and I've enountered something odd when it comes to code hints. On page 225, on step 3 I typed:
    $dbWrite = new Zend
    ...And code hints pop up, but neither Zend_Db_Adapter_Mysqli nor Zend_Db_Adapter_Pdo_Mysql are among the choices offered. The closest I get is "Zend_Db".
    I also tried typing "pdomy" like it says in the book, but still no cigar.
    I finished writing the code and tested the script in step 5 and it works fine. I just don't understand why those classes are not included in the code hints.

    Also, the same thing happened in step 5 when I tried to type $dbWrite->getConnection().
    no code hints popped up at all.

  • Has anyone else been getting emails about reseting password

    Has anyone else been getting emails about reseting password when they have not requested it? I have been getting several emails for the past couple of days where it says how to reset when I never asked to do so. Is there anything that should be done about it? Or anything apple can do about it for my email is very different and not easy to guess or duplicate.

    you got the ping app, this app is sending greeting pings and message of promo price for it in the cost version

  • Hi, I have answered no to the question about saving password for one spesific site. I have changed my mind and would like Firefox to save the password. How do I reactivate the password saver for one spesific site?

    Hi, I have answered no to the question about saving password for one spesific site. I have changed my mind and would like Firefox to save the password. How do I reactivate the password saver for one spesific site?

    Check exception list of your Firefox password Manager and check if your site is there or not?
    * http://kb.mozillazine.org/User_name_and_password_not_remembered#Password_Manager_settings

  • TS1424 itunes purchase security questions & answers reset and answered correctly.  Can not log in with updated answers which state one or both are incorrect.

    Can anyone help with this situation?
    itunes purchase security questions & answers reset and answered correctly.  Can not log in with updated answers which state one or both are incorrect.

    You need to contact Apple to get the questions reset. Click here, phone them, and ask for the Account Security team, or fill out and submit this form.
    (94948)

  • Does electronic version Adobe Dreamweaver CSS with PHP content question

    Does electronic version Adobe Dreamweaver CSS with PHP come with the labs or files used in a college course?  What is on the CD and is there a way to get the content with the Barnes and Noble e-book?  This should be a Barnes and Nobel question but they seem to have troubles answering the questions like this.

    Electronic version comes with absolutely nothing about your course.   All you get is everything in this link:
    <http://www.adobe.com/cfusion/tdrc/index.cfm?product=dreamweaver>
    The link will give you 30 days of free use of DW after which you might get bored with DW or you will have given up on your course and started your own business to pay your school fees.
    hth

  • David Powers cs5 with php...Zend

    This one is aimed for David Powers. We are using your book for my advanved programming class. I continually have problems because they had us buy a domain instead of the one the book does it. At this point I'm on page 222ish, installing Zend. Obviously I'm using dreamweaver and my domain is with godaddy.com. I'm doing the section where you are are installing the library. I've got the library.php with no errors, I'm connected to my domain, and I have the zend file inside my local site folder. I've tried in the C drive but I cotinually get the same error:
    Warning: require_once(Zend/Loader/Autoloader.php) [function.require-once]: failed to open stream: No such file or directory in/home/content/79/7340479/html/library.php on line 4
    Fatal error: require_once() [function.require]: Failed opening required 'Zend/Loader/Autoloader.php' (include_path='.:/usr/local/php5/lib/php:C:\Users\Becky\Desktop\colts\ZF\ZendFramework-1. 11.4-minimal\library') in /home/content/79/7340479/html/library.php on line 4
    I've tried putting the zend folder in c, desktop, in side local site folder and same thing everytime. Any help would be appreciated.

    Re: David Powers cs5 with php...Zend
    Ok I'm gonna try and help ya until David gets here. Since I use Zend and have read parts of his book.
    First, are you trying to install zend at godaddy?
    Your include file is odd. "include_path='.:/usr/local/php5/lib/php:C:\Users\Becky\Desktop\colts \ZF\ZendFramework-1.11.4-minimal\library') in/home/content/79/7340479/html/library.php" - means PHP and Zend are located on 2 different machines
    I appreciate it. the "C:\Users\Becky\Desktop\colts \ZF\ZendFramework-1.11.4-minimal\library' is where the file path.I use Godaddy but I have it zend on my computer and am just trying to get it to run. I tried running it from desktop, C:(where it's at), andneven put it in the file manager on godaddy and tried that path...
    the code I'm using is:
    <?php
    $library = 'C:\Users\Becky\Desktop\colts\ZF\ZendFramework-1.11.4-minimal\library';
    set_include_path(get_include_path() . PATH_SEPARATOR . $library);
    require_once('Zend/Loader/Autoloader.php');
    $loader = Zend_Loader_Autoloader::getInstance();
    if ($loader) {
    echo 'OK';
    } else {
    echo 'We have a problem';
    I'm followed the book step by step but...
    when i click autoloader.php in the tab bar it has a get option. but when i click it it says "operation failed because it is not on the remote site.

  • 2 questions about SmartWare (password protection, resume after standby)..

    Hi guys, 2 quick questions about the SmartWare utility. I have searched for previous answers, but couldn't find any. Might be that I uses the wrong search terms though, so sorry in advance if this had been asked (and aswered) before. When I create a backup, it is being stored file-by-file in the "SmartWare" folder on the NAS. Since the SmartWare folder is public, all users with access to the drive can access this folder. Ultimately this means that ALL users of the drive can access the backup files of ANY user. If someone performs a full backup, this means that anyone has access to ALL the data of that person. I could't find any option in SmartWare to password-protect backups or something. From a security point of view, I would consider this as a worst-case scenario. Even worse is that there is no mentioning of this in the user's manual. Am I missing something here? Is there a way to protect backups against access by any other user? If this is really not possible, I would consider this application to be pretty much useless, to say the least. "Dangerous" would be a better description... My 2nd question is only relevant if there's a solution for the first one, because else I would't use this tool anyway: Does it automatically resume a backup if the machine is put to standby or hibernation mode during a backup operation, or will it restart from the start, or will the backup be interrupted (and thus useless)? Many thanks in advance!

    One can create a Private Share on the WD My Cloud, configure it so only one user has access (password protected), then one can configure the SmartWare software to backup to that private share folder. One changes the backup location in the SmartWare program by selecting the dropdown selector box below the "WD My Cloud" on the Smartware "Home" screen. The Smartware User Manual explains this process under Chapter 5, Backing up Files, step 2, substep c. Smartware should resume the backup when ever it is interrupted. Here is how it is explained in the Smartware User Manual:Note: Backup protection is automatic for as long as the backup source and target devices are connected to your computer. Then, whenever you disconnect and reconnect either device, the WD SmartWare software rescans the backup source device for new or changed files and resumes automatic backup protection. 

  • Question about using passwords on Visio

    I have another question about the Vision:M. I was curious if you're able to password protect certain folders so that in order to access them, you have to put in a password. I know you can password protect files so it can't be messed with or whatever, but it doesn't stop the files from being viewed. Is there any way to do this?

    jessevsm wrote:
    I have another question about the Vision:M. I was curious if you're able to password protect certain folders so that in order to access them, you have to put in a password. I know you can password protect files so it can't be messed with or whatever, but it doesn't stop the files from being viewed. Is there any way to do this?
    there is an option somewhere in the settings menu to hide protected files, so you can't see them or edit them till the password is entered.

  • Implementing Security Questions to reset password

    Hi there,
    we want to activate to solution, that a user, who forget his password, to reset their password with a securityquestion and answer.
    I set the parameter in UME-Properties and User Admin UI tab and create the UME-Roles,
    but after click on Help button at loginscreen, I see only four fields to enter:
    Username, Firstname, lastname and eMail.
    Anybody knows some hints?
    System is EP7 SPS15
    Best regards
    Christian

    Christian
    My 2 cents
    Cent 1:
    In order to see a security question, there should be a security answer setup.
    Once logged in as a user, go to Personalization and check that security question/answer are in place. If you setup self service correctly, you should be able to do see and setup them.
    Cent 2:
    Double check that the ume properties you setup via EP GUI are correct. There are consistency issues between EP Wizard and actual property values sometimes. Login to Config Tool and verify ume properties
    in com.sap.security.core.ume.service:
    ume.logon.logon_help
    ume.logon.logon_help.name_required          
    ume.logon.logon_help.securityquestion          
    If you change anything, restart the cluster.
    Regards,
    Slava

  • Question about reseting my ipod touch

    i want to reset it but i need to know if the user names and passwords for my social networking apps are saved on my pc when it synced wth it after i was done and had to charge it

    I ordered mine on the 1st. Was told the estimated delivery is between the 10th and 14th. But, I got it already. It was shipped out on the 6th from China. So, it took about 2 days from oversea to my hands. (China-->Alaska-->NY) So, I think you should get it early next week.

  • Question about Resetting Widgets and Linking

    Hi everyone!
    This is actually my first day on this forum so please forgive me that I haven't participated in discussions. But I have a few questions and any insight into these would be extremely helpful!
    My first question is: Is there a way to reset the entire iBook to its original state, where no answers are marked in to quiz questions and other used widgets are reset to their original views? Or would the entire book just need to be deleted and redownloaded again? The reason why I wanted to know is because our particular project would be used in a classroom setting and multiple children might use the same book and participate in the same widget activities. Being able to reset the activities to their default would allow the new user to not already see the previous user's responses.
    My second question is: Has anyone found a work-a-round to getting the links to work better? For example, creating a references page, and having items in the iBook link to the references page, and having the references page link back to the original page? I found a way to create a references page, and get the pages to link back and forth to each other but only if I placed a gallery or interactive activity on both pages. Is there a way to link one page to another without an interactivity?
    Thanks so much for looking at my questions! Any help regarding either of them would be great.

    1.) There is a [Clear Answer] button at the bottom of each review widget. Design and execute a process between sessions to use it, or delete that book and push a new one.
    2.) This gets asked a lot
    The answer is always the same. There is no reverse path outside of creating another pair of interactive bookmark/hyperlinks to create one. A→B & B→A

  • Few question about reset DatagramChannel

    Hello,
    Im doing a communication program that uses Selectors with DatagramChannels, and implement bradcast receiving and sending.
    I was assigned to create a reset function, that should reset the communication in cases it gets stuck.
    When I close the DatagramSocket of the channel, it stays bounded, so I can't create new channel and bind it to the same port.
    Im new to this subject so i have some questions:
    1. When Im broadcasting, i don't have to connect, only to bind, right?
    2. Is there any way to "unbind"?
    3. Is it neccessary to do the reset? I mean, can a DatagramCahnnel even get stuck?
    Thanks
    Udi

    When I close the DatagramSocket of the channel, it
    stays bounded, so I can't create new channel and bind
    it to the same port.Call Selector.selectNow() after closing the DatagramSocketChannel or its DatagramSocket.
    1. When Im broadcasting, i don't have to connect,
    only to bind, right?Right
    2. Is there any way to "unbind"?See above
    3. Is it neccessary to do the reset? I mean, can a
    DatagramCahnnel even get stuck?No.

  • Adobe Reader Question about protected password

    I have adobe reader on my computer and I need to email an pdf file and password protect it, is that possible with the reader version?

    Kimberly,
    Moving this question to the Adobe Acrobat forum, since it's not related to CreatePDF.
    No, you cannot password protect a PDF with Reader. This requires Adobe Acrobat. See the "Protect" section here. A trial is here.
    Dave

Maybe you are looking for