Sargis Andreyan Sargis Andreyan - 3 months ago 8
PHP Question

What is wrong in this code, it returns sytax error

<?php
if(!empty($_GET['errormsg']))
{
echo $_GET['errormsg']
};
?>


What is wrong in this PHP code. It returns the following error:


Parse error: syntax error, unexpected '}', expecting ',' or ';' in *************************** on line 47

Answer

Your ; is placed after }. The ; should precede the }.

Try that :

<?php
    if(!empty($_GET['errormsg'])){echo $_GET['errormsg'];}
?>
Comments