Jump to content
Larry Ullman's Book Forums

Recommended Posts

	// Check for a password and match against the confirmed password:
	if (strlen($trimmed['password1']) >= 10) {
		if ($trimmed['password1'] == $trimmed['password2']) {
			$p = password_hash($trimmed['password1'], PASSWORD_DEFAULT);
		} else {
			echo '<p class="error">Your password did not match the confirmed password!</p>';
		}
	} else {
		echo '<p class="error">Please enter a valid password!</p>';
	}
Link to comment
Share on other sites

        <p><label for="password"><strong>Password</strong></label>
        <?php create_form_input('password1', 'password', $reg_errors); ?></p>
        <?php if (isset($trimmed['password1'])) echo $trimmed['password1']; ?></p>
       	<p class="noticeType"> Must be between 6 and 20 characters long, with at least one lowercase letter, 
        one uppercase letter, and one number.</p>

 

Link to comment
Share on other sites

I have reworked this page and code several times since posting and believe I have been able to correct that problem. I changed an area that said pass1 to password.

NOW I am wondering how to format the error messages so that they are in the body of the form like they were in the eCommerce scripts OR how to format them so that they look good rather than just spreading across the top of the page. Can one use CSS in the PHP script?

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...