Hi
I am trying to add a small piece of code to a script to validate two user inputs.
- Whether a minimum bid is less that 20 - if so show an error; and
- Check that the maximum bid is higher than the minimum bid - if not show an error
The existing code checking other inputs is:
if(strlen($_POST['project_name']) <= 0)
{
$errors[]['message'] = $lang['PROJECTTITLEMISSING'];
}
if(!isset($_POST['jobtype']))
{
$errors[]['message'] = $lang['PICK1JOBTYPE'];
}
if(strlen($_POST['project_description']) <= 0)
{
$errors[]['message'] = $lang['PROJECTDESCRIPTIONMISSING'];
}
I have tried
if(!isset($_POST['budget_min']) < 20)
{
$errors[]['message'] = $lang['ERRORMINBUDGET'];
}
to check whether the budget_min is less than 20 and if so show an error. This shows the error but regardless of the value entered. How do I alter this to check the numeric value?
Thereafter, I need to check that budget_max is greater than or equal to budget_min and would be grateful if someone could point me in the right direction.
Many thanks
Mark