Hello sorry if the question is not proper / clear. which one of these two ways is better to validate.
<?php
# using a variable
$query = $_POST['query'];
$ok = FALSE;
if ( $query = 'php' ){ $ok = TRUE;}
else { $ok = FALSE;}
if ( $ok = TRUE; ){ // more code
}
# direct way
$query = $_POST['query'];
if ( $query = 'php' ){ // more code
}
else { // more codes
}
?>
Thanks in advance.