samedi 5 mars 2016

PHP $_POST using same variable [duplicate]

This question already has an answer here:

I'm making an expert system like program and having a problem in using the same variable(e.g symptom7 in condition 2 and another symptom7 in condition 3. The variable comes from the checkbox form from another page. Sorry for this noob problem coz I really spent alot of time in fixing this and I cant solve it.

Notice: Undefined index: symptom1 in C:\wamp\www\proj\result.php on line 2
Notice: Undefined index: symptom7 in C:\wamp\www\proj\result.php on line 7
Notice: Undefined index: symptom7 in C:\wamp\www\proj\result.php on line 11


<?php 
    if ($_POST['symptom1'] == '1' AND $_POST['symptom2'] == '1' AND $_POST['symptom3'] == '1' AND $_POST['symptom4'] == '1' AND $_POST['symptom5'] == '1' AND $_POST['symptom6'] == '1' )

        { 
        header("Location:http://localhost/proj//AcuteBronchitis.jsp");
        }
    if ($_POST['symptom7'] == '1' AND $_POST['symptom8'] == '1'  AND $_POST['symptom9'] == '1' AND $_POST['symptom10'] == '1' AND $_POST['symptom11'] == '1'  AND $_POST['symptom12'] == '1')   
        {
        header("Location:http://localhost/proj//Asbestosis.jsp");
        }
    if ($_POST['symptom7'] == '1' AND $_POST['symptom1'] == '1' AND $_POST['symptom13'] == '1' AND $_POST['symptom14'] == '1')  
        {
        header("Location:http://localhost/proj//Asthma.jsp");
        }   
?>




Aucun commentaire:

Enregistrer un commentaire