I am creating a website where I try to respect the Model, View, Controller architecture. Sometimes I am calling php functions in the html View part such as in the form bellow:
<html>
<form role="form" action="#" method="POST">
<div class="col-sm-6">
<?php $workinghours->isCheckedWH($db, 'workinghours', $id, 'day', 'open', 'closed', 'check_list[]'); ?>
</div>
<div class="row">
<div class="col-sm-offset-1 col-sm-8">
<br>
<button type="submit" class="btn btn-default" name="modify_wh" value="modify">Modify</button>
</form>
</html>
Is there any risks in terms of security for doing this? Could someone modify the parameters in the function to make evrything crash. If yes, what would be the best solution to prevent it?
Thanks a lot.