Need help please,....Query script for multi varible form

Discussion in 'PHP' started by junandya, Oct 24, 2007.

  1. #1
    Hello,...

    i have same problem with a form, this form has 4 fields, they are:
    - name
    - industry
    - country
    - date

    the rule is, at least 1 field has to be selected and can leave the other one. this condition is confusing me,... because there are so many combination for it. And i dont understand about the logic for the PHP script & mysql query,....please help, i really need it.


    Best Regards
    Junandya
     
    junandya, Oct 24, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    
    
    $_POST = array_map('trim', $_POST);
    
    if (!empty($_POST['name']) OR !empty($_POST['industry']) OR !empty($_POST['country']) OR !empty($_POST['date']))
    {
        // Okay
    }
    
    PHP:
     
    nico_swd, Oct 25, 2007 IP