JezK
Edit File: reportProblem.php
<?php include("header.php"); if(isset($_POST['action']) && $_POST['action']=='reportproblem') { $reportProblem=$videocon->reportProblems($_POST); //echo "--Report Problem--".$reportProblem;exit; if($reportProblem){ echo "<script>alert('Your report problem is sent successfully');window.location='reportProblem.php';</script>"; }else{ echo "<script>alert('Your report sending failed.');</script>"; } } ?> <style> div.dataTables_wrapper div.dataTables_filter { position: absolute; top: 154px; } .page { height: 100% !important; } </style> <section class="section-padding px-4 "> <div class="container bg-white px-0" style="height:465px;"> <div class="row"> <div class="col-12 col-sm-12 my-3 px-5"> <form action="" method="POST"> <div class="form-group"> <label for="subject" class="fieldName">Subject</label> <input type="text" class="form-control formField-control" name="subject" id="subject" value="<?php if(isset($_POST['subject']) && $_POST['subject']!=''){ echo $_POST['subject'];}?>"> </div> <div class="form-group"> <label for="message" class="fieldName">Message</label> <textarea class="form-control formField-control resize-none" name="message" id="message" rows="5"><?php if(isset($_POST['message']) && $_POST['message']!=''){ echo $_POST['message'];}?></textarea> </div> <input type="hidden" name="action" value="reportproblem"> <div class="form-group mt-4 mb-2 col-12 col-sm-6 col-lg-3 co-md-6 p-0"> <button class="btn basic-btn-color w-100" onclick="return reportAproblem();">Send</button> </div> </form> </div> </div> </div> </section> <?php include("footer.php"); ?> <script type="text/javascript"> function reportAproblem() { if($('#subject').val()=='') { alert("Please enter subject");return false; } else if($('#message').val()=='') { alert("Please enter message");return false; } } </script>