Problems with server side validation

olaeblue 03 Jan, 2012
Why do neither of these php statements on the server side validation action capture the fact that both emails are the same ? I'm sure the code is correct but....;

<? php
if ( $form->email = $form->email_orig ) {
  return false;
}
?>
<? php
if ( $form->data['email'] = $form->data['email_orig'] ) {
  return false;
}
?>


Debug output is

[email_orig] => [email]andy_syme@xxxxxx.com[/email]
[email] => [email]andy_syme@xxxxxx.com[/email]

Thanks in advance for any advice.
olaeblue 03 Jan, 2012
OK worked it out
<?php
NOT
<? php

DOH😶
GreyHead 03 Jan, 2012
Hi olaeblue,

And you need == in the if clauses too.
if ( $form->email == $form->email_orig ) {


Bob
This topic is locked and no more replies can be posted.