I am trying to make a function that will allow me to easy display messages in my pages using PHP.
My function:
/*
* Function to easy write modal / help boxes
*/
function modal($title, $message)
{
echo '
<!-- HELP MODAL -->
<div style="display:none;">
<div id="help" class="modal-content inline">
<h3>'.$title.'</h3>
'.$message.'
</div>
</div>
<!-- END HELP MODAL -->
';
}
And my PHP code:
<?php echo modal("Title Message","Message <br /> <a href='link'>link</a>"); ?>
This does not work. I have turned on error_reporting, but see no error.
What am I doing wrong?
Try to
returnthe echo statement from your modal function.OR
Make a
exitafter echo statement in your modal function