Parse error: syntax error, Unexpected '

Asked

Viewed 150 times

-1

I have a mistake:

Parse error: syntax error, Unexpected 'Medicavalidade'

 Trabalhador (1) Validade:';
If (($exibe['MedicaValidade'] != 0000-00-00) && ((strtotime($exibe['MedicaValidade']) < time()))) {
echo '<span style="color:red">'.$exibe['MedicaValidade'].'</span>';
echo 'Anexo: <a href="MostrarMedica.php?id=' . $exibe['id'] . '">Ver PDF  </a>'
} elseif ((strtotime($exibe['MedicaValidade']) >= time()) {
echo '.$exibe['MedicaValidade'].';
echo 'PDF: <a href="MostrarMedica.php?id=' . $exibe['id'] . '">Ver PDF  </a>
}

1 answer

2

Mistakes: has quotes between '0000-00-00', missing quotes and line terminator(;) missing.

if ($exibe['MedicaValidade'] != '0000-00-00')
{
   if (strtotime($exibe['MedicaValidade']) < time()) 
   {
        echo '<span style="color:red">'.$exibe['MedicaValidade'].'</span>';
        echo 'Anexo: <a href="MostrarMedica.php?id='. $exibe['id'].'">Ver PDF</a>';
   } else {
        echo $exibe['MedicaValidade'];
        echo 'PDF: <a href="MostrarMedica.php?id='.$exibe['id'].'">Ver PDF</a>';
   }
}
  • have this error on the line of Elseif Parse error: syntax error, Unexpected '{' in

  • @user3253195, ready, edited!

  • What changed? Because now I have the same error on the line { echo $displays['Medicavalidade']; echo 'PDF: <a href="Showmedica.php? id=' . $displays['id'] . '">View PDF </a>'; }

  • I made another edition improving, now check if it goes!

  • I have the same error now on second { .. I was asking to try to correct.

  • @user3253195 look again

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.