For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > June 2004 > 2 requests: validate 2 password fields as equal and rewrite data









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author 2 requests: validate 2 password fields as equal and rewrite data
Vincent Jordan

2004-06-28, 8:56 am

Could someone instruct me or point me in the right direction. I would like to have a <input type=password name=password> <input type=password name=password2> when submit it will check to se if password and password2 are = ( i do not want password2 to end up in POST on submit.)

also i am trying to rewrite data from a tinyint. the tinyint will return 1 or 0, I have tried but can not seem to get it right. pretty much if it returns 1 i want display active where if 0 display not active. I have tried the following:

$act = mysql_query("select isactive from acl where isactive '1'")
if ($act)
{
while ($isact = mysql_fetch_array($act))
{
echo "Active";
}
}
else
{
echo "Not Active";
}

i have also tried:

if $row[isactive] = '1'
{
echo "active";
}
else
{
echo "Not Active";
}

im suue i have screwed up the syntax somewhere. I have looked on google and picked thru several scripts i have found online but have been unsuccessful. aly help appriciated.


Vinny

Torsten Roehr

2004-06-28, 8:56 am

>"Vincent Jordan" <vjordan@extendedpop.com> wrote in message
news:002c01c45ca9$cffcdbe0$fe00000a@exte
ndeddwc7l0...
>Could someone instruct me or point me in the right direction. I would like

to have a <input type=password name=password> ><input type=password
name=password2> when submit it will check to se if password and password2
are = ( i do not want >password2 to end up in POST on submit.)
>
>also i am trying to rewrite data from a tinyint. the tinyint will return 1

or 0, I have tried but can not seem to get it >right. pretty much if it
returns 1 i want display active where if 0 display not active. I have tried
the following:
>
>$act = mysql_query("select isactive from acl where isactive '1'")


I think you missed the = on the above line. This should be the correct
syntax:
$act = mysql_query("select isactive from acl where isactive = 1");

>if ($act)
>{
>while ($isact = mysql_fetch_array($act))
>{
>echo "Active";
>}
>}
>else
>{
>echo "Not Active";
>}
>
>i have also tried:
>
>if $row[isactive] = '1'


The above should be:
if ($row['isactive'] == 1)

>{
>echo "active";
>}
>else
>{
>echo "Not Active";
>}
>
>im suue i have screwed up the syntax somewhere. I have looked on google and

picked thru several scripts i have found >online but have been unsuccessful.
aly help appriciated.
>
>Vinny

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com