I've got a "validation script" on the first line of my page. It's right before <!DOCTYPE html>
. The script validates the input and if there's an error, it should display an error somewhere upon the footer in the html part. There are more php script all over the html.
So how do I display an error in an other part than in the start of page (the part with php script)?
Little example how it looks like:
<?php
if($form->isValid())
{
// redirect
}
else
{
// a function to display error upon the footer ?
}
?>
<!DOCTYPE html>
<head>
</head>
<body>
<div class="example">
<?php // some other script
foreach(...){ ?>
<a href=""><?php echo $a[0]; ?></a>
<?php } ?>
</div>
<!-- Here it should display the error -->
<footer>
</footer>
</body>
</html>
I'm quite a beginner so I would very appreciate your help!