Please login or register.

Login with username, password and session length
Advanced search  

News:

Get quality web hosting, virtual private servers, reseller web hosting, and dedicated servers from www.webhostfreaks.com or www.serverpowered.com!

Maintenance Notice

PHPFreaks has successfully moved to a new Dedicated Server, hosted by Server Powered. Please help support future upgrades by Donating.

Author Topic: validate arrays  (Read 51 times)

0 Members and 1 Guest are viewing this topic.

kabucek

  • Irregular
  • Offline Offline
  • Posts: 23
    • View Profile
validate arrays
« on: November 19, 2008, 01:57:42 PM »
ok now I got this to work with arrays
but I don't know how to setup in such way,
when first array is ok, it goes to the next one.


Code: [Select]
[PHP]<?







// I have   2 arrays and want them to do:
//   - if one is complete go to next:




// array 1  \\



      if ($checkMemberArray)


                          {




$cemailAdr=strtolower($checkMemberArray['emailAdr']);


                $memailAdr=strtolower($memberDataArray['emailAdr']);




                          if ($cemailAdr!=$mcemailAdr )
           
           
            {





$command="sendAccountMail"; $destPage=$PHP_SELF; $label="here";

$quote="\"";

$clickString="onClick=".$quote."document.$formName1.operation.value='$command'; document.$formName1.action='$destPage'".$quote;

$hrefString="href='javascript:submitRoutine($quote$command$quote, $quote$formName1$quote)'";

if (!$label) { $label=$command;}

$$command="<A $hrefString $clickString>$label</A>";

$errorArray['emailAdr']="Email Already registered";

$processMsg.="

<DIV class=processMsgError>

.<P>
                                                            Our records shows that this email has been registered for this event <P>
                                                            Please provide different email address

</DIV>

";

}


  //end of array 1  \\



  // array 1  \\


        if ($checkMemberArray)

{

$cFirst=strtolower($checkMemberArray['first']);

$cLast=strtolower($checkMemberArray['last']);

$mFirst=strtolower($memberDataArray['first']);

$mLast=strtolower($memberDataArray['last']);

if ($cFirst!=$mFirst or $cLast!=$mLast)

{

$command="sendAccountMail"; $destPage=$PHP_SELF; $label="here";

$quote="\"";

$clickString="onClick=".$quote."document.$formName1.operation.value='$command'; document.$formName1.action='$destPage'".$quote;

$hrefString="href='javascript:submitRoutine($quote$command$quote, $quote$formName1$quote)'";

if (!$label) { $label=$command;}

$$command="<A $hrefString $clickString>$label</A>";

$errorArray['emailAdr']="Mismatch email and name";

$processMsg.="

<DIV class=processMsgError>

Email doesn't match our records. It has been registered already with different First & Last Name<P>

   There needs to be different f.name and l.name for each of the registrants



</DIV>

";

}

else

{

$memberDataArray['first']=$checkMemberArray['first'];

$memberDataArray['last']=$checkMemberArray['last'];

}

}

}




    //end of array 2  \\










?>[/PHP]
Logged

corbin

  • Guru
  • Fanatic
  • *
  • Offline Offline
  • Posts: 4,087
    • View Profile
Re: validate arrays
« Reply #1 on: November 20, 2008, 06:53:32 PM »
Are you looking for a nested if?
Logged

Why doesn't anyone ever say hi, hey, or whad up world?
Now I'll be uncreative, and put stats no one cares about.
Win Vista (It doesn't suck!) | Apache 2.2 | PHP 5.2 | MySQL 5 | MSSQL 2008
Fedora Core 9 | Apache 2.2 | PHP 5.2 | MySQL 5
After all, why would you insert your penis into a hole for no reason whatsoever?
Pages: [1]
 

Page created in 0.037 seconds with 19 queries.