I am new to PHP and I would like to know the correct way to display error in index.php but only if there are errors otherwise it does nothing.
The page index.php send the form to login.php if there are errors it return the error to index.php like this:
index.php?error=1
Then in index I have the follow code but it feels like the page got slow
<?php
if ($_GET['error']==1){echo "We show error 1 ...";}
if ($_GET['error']==2){echo "We show error 2 ...";}
if ($_GET['error']==3){echo "We show error 3 ...";}
?>
How can I fix it the correct way? Some uses the if isset but I dont know how to use this funtion it give me errors