hemi519
01-20-2011, 09:34 AM
Hi All,
i wrote a code for checking password and retype password same or not .Iam unable to go further and make it work.Can anyone help me in this. This is my code
I am getting this from register .html to validate.php. The below code belongs to validate.php.In Html i am just passing the value for these options.
switch ($type) {
case 'password':
validatePassword($value);
break;
case 'repassword':
validateRepassword($value);
break;
}
function validatePassword($value) {
if(ereg("[a-zA-Z0-9^,<>?/*()&^\%$#!~`]{4,9}$", $value, $regs)) // for some reason if i keep @ in the ereg expression it gives me error//
{
echo "true";
} else {
echo "false";
}
}
function validateRepassword($value) {
if(ereg("[a-zA-Z0-9^,<>?/*()&^\%$#!~`]{4,9}$", $value, $regs))
{
echo"true";
validateCheck();
}
else {
echo "false";
}
}
Now how can i check if both are same or not and how can i check the ereg expression for address field which can accept any type of character
i wrote a code for checking password and retype password same or not .Iam unable to go further and make it work.Can anyone help me in this. This is my code
I am getting this from register .html to validate.php. The below code belongs to validate.php.In Html i am just passing the value for these options.
switch ($type) {
case 'password':
validatePassword($value);
break;
case 'repassword':
validateRepassword($value);
break;
}
function validatePassword($value) {
if(ereg("[a-zA-Z0-9^,<>?/*()&^\%$#!~`]{4,9}$", $value, $regs)) // for some reason if i keep @ in the ereg expression it gives me error//
{
echo "true";
} else {
echo "false";
}
}
function validateRepassword($value) {
if(ereg("[a-zA-Z0-9^,<>?/*()&^\%$#!~`]{4,9}$", $value, $regs))
{
echo"true";
validateCheck();
}
else {
echo "false";
}
}
Now how can i check if both are same or not and how can i check the ereg expression for address field which can accept any type of character