PHP Validation?

Status
Not open for further replies.

sharad.jash

New Member
I need to figure out how the php validation works?

My requirement is to validate value of some field > (some value) and a dropdown value != (some value)

How can I do that ?
 
Dear troester,

I read the wiki before posting the thread...
Here my piece of code for php validation

$app = JFactory::getApplication();
$f = $app->input->get('tport_book___gp', 0, 'INT');
if($f <=6000 && $data =='lpt@bac.com'){ /* it should show error message if value of less than equal to 6000 AND email id is equal to lpt@bac.com*/
return false;
}
else{
return true;
}

Can you suggest me what I'm doing wrong ?
Thanks in advance...
 
I can't see anything obvious.
For debugging add
var_dump($f,$data);exit;
before the if
 
Dear troester,

thanks for the reply!!After dumping the data i got the values of $f as 2304testint(7000) string(18)

where 7000 is the data I was looking for!!

2304 & test are the values of other columns.

Is it a way to collect that data from this ?

Thanks in advance...
 
i tried both
in var_dump() i got -- 2304testint(7000) string(18)
and in echo i got -- 2304test7000

Any idea how ?
 
Actually I have applied one more validation where I'm validating string content.

I modified that and It worked!! Thanks to you for your prompt support!!!! :)
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top