-
Notifications
You must be signed in to change notification settings - Fork 0
/
add.php
52 lines (41 loc) · 1.06 KB
/
add.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
<?php
include 'inc/header.php';
include 'lib/student.php';
?>
<?php
$stu = new Student();
if( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
$name = $_POST['name'];
$roll = $_POST['roll'];
$insertdata = $stu->insertStudent($name, $roll);
}
?>
<?php
if(isset($insertdata)) {
echo $insertdata;
}
?>
<div class="panel panel-default">
<div class="panel-heading">
<h2>
<a class="btn btn-success" href="add.php">Add Student</a>
<a class="btn btn-info pull-right" href="index.php">Back</a>
</h2>
</div>
<div class="panel-body">
<form action="" method="post">
<div class="form-group">
<label for="name">Student Name</label>
<input type="text" class="form-control" name="name" id="name" required="">
</div>
<div class="form-group">
<label for="roll">Student Roll</label>
<input type="text" class="form-control" name="roll" id="roll" required="">
</div>
<div class="form-group">
<input type="submit" class="btn btn-primary" name="submit" value="Add-Student">
</div>
</form>
</div>
</div>
<?php include 'inc/footer.php'; ?>