-1

I get a Parse error: syntax error when I echo 2 checkbox rows. I think there is something with the 2nd tag because the first checkbox: FILM DRAAI DAGEN. echo's right.

 <tr>
    <td>
        <?php echo 'Film draai dagen: ';?>
    </td>
    <td>
<?php
if(!empty($_POST['draaidag']))
{
    foreach($_POST['draaidag']as$check)
    {
        echo " ".$check;
        $draaidag = " ".$check;
    }
?>
    </td>
</tr>

<tr>
    <td>
        <?php echo 'Film tijd dagen: ';?>
    </td>
    <td>
<?php
if(!empty($_POST['tijddag']))
{
    foreach($_POST['tijddag']as$check)
    {
        echo " ".$check;
        $tijddag = " ".$check;
    }
?>
    </td>
</tr>
RiggsFolly
  • 93,638
  • 21
  • 103
  • 149

1 Answers1

-1

Syntax error means your code has errors. In this case you did not close the if statement. Simply add a curly brace at the end before your closing tag.

<td>
<?php
    if(!empty($_POST['draaidag']))
    {
        foreach($_POST['draaidag']as$check)
        {
            echo " ".$check;
            $draaidag = " ".$check;
        }
    } //<--- this guy
?>
</td>
RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
Brian Patterson
  • 1,615
  • 2
  • 15
  • 31