[Solved] Check if a form is filled or not using PHP


Use numeric naming. Instead of one_two_txt, just use 1_2. This way, you can loop through it.

$filled = 1;
for($c = 0; $c <= 6; $c++)
{
    if($filled == 0)
    {
        break;
    }
    for($r = 0; $r <= 20; $r++)
    {
        if(strlen($_POST["" . $c . "_" . $r . ""]) <= 0)
        {
            $filled = 0;
            break;
        }
    }
}

If $filled is equal to 0, then there is an empty field, so you could post the user back to the form or whatever you want to do.

1

solved Check if a form is filled or not using PHP