Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Wed Jul 17, 2013 2:22 am


Postby vamshi » Wed Jul 17, 2013 2:27 am

hi, i am new to php i have my page i have password and re-type password text box's so when two password matches it has to submit otherwise it has to show error password mismatch pls help me

php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: php

Postby johnj » Wed Jul 17, 2013 7:45 pm

1).write a form to collect both the passwords

2).at the place where you process these passwords (you will have to collect the two passwords from the form), do something like this:

Code: Select all

$password = $_POST['password'];
$retypedpassword = $_POST['retypepassword'];

if ($password === $retypedpassword)
    echo "The passwords match";
    echo "The passwords do not match";

Return to “PHP coding => General”

Who is online

Users browsing this forum: Baidu [Spider], Yahoo [Bot] and 11 guests