Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

php

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

php

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

hi, i am new to php i have problem.in 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
vamshi
New php-forum User
New php-forum User
 
Posts: 1
Joined: Wed Jul 17, 2013 2:22 am

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";
}
else
{
    echo "The passwords do not match";
}
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron