-
Notifications
You must be signed in to change notification settings - Fork 1
/
report_bug.php
81 lines (81 loc) · 3.68 KB
/
report_bug.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!--Template page for IDCP-->
<?php
$title = "Report a Bug";
$page = 'report_bug';
require('includes/header.php');
require( 'includes/connect_db_c9.php' ) ;
if ($_SERVER[ 'REQUEST_METHOD' ] == 'POST') {
// $to = '[email protected]';
// $subject = 'the subject';
// $message = 'hello';
// $headers = 'From: [email protected]' . "\r\n" .
// 'Reply-To: [email protected]' . "\r\n" .
// 'X-Mailer: PHP/' . phpversion();
// mail($to, $subject, $message, $headers);
$name = $_POST['name'];
$email = $_POST['email'];
$comment = $_POST['comment'];
$query = "INSERT INTO BUG_REPORT(NAME, EMAIL, COMMENT) VALUES('$name', '$email', '$comment')";
$result = mysqli_query($dbc, $query);
if ($result){
?>
<div class="alert alert-success alert-dismissible" role="alert" style="margin-top: 20px">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<strong>Success!</strong> Bug report has been submitted.
</div>
<?php
}
}
?>
<!-- Page Content -->
<div id="page-content-wrapper">
<div class="container-fluid">
<div class="dropdown">
<div class="page-header">
<h1>Report a Bug</h1>
</div>
<form name="contactform" method="post" action="report_bug.php" class="form-horizontal" role="form" data-toggle="validator">
<div class="form-group">
<label class="col-xs-3 control-label">Name *</label>
<div class="col-xs-2">
<input type="text" class="form-control" name = "name" data-error="Please enter your name" required>
</div>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
<label class="col-xs-3 control-label">Email *</label>
<div class="col-xs-2">
<input type="email" class="form-control" name = "email" data-error="Please enter your email" required>
</div>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
<label class="col-xs-3 control-label">Comment *</label>
<div class="col-xs-2">
<textarea class="form-control" rows="5" id="comment" name = "comment" data-error="Please enter a bug comment" required></textarea>
</div>
<div class="help-block with-errors"></div>
</div>
<br><br>
<div class="form-group">
<div class="col-xs-5 col-xs-offset-3">
<button type="submit" class="btn btn-success">Submit</button>
</div>
</div>
</form>
</div>
</div>
<!-- /#page-content-wrapper -->
</div>
<!--Footer-->
<?php require('includes/footer.php'); ?>
</div>
<!-- /#wrapper -->
<!-- jQuery -->
<script src="js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
<!-- Bootstrap Form Validator -->
<script src="js/validator.js"></script>
</body>
</html>