-
Notifications
You must be signed in to change notification settings - Fork 0
/
student_new.php
44 lines (40 loc) · 1.16 KB
/
student_new.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
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
require_once 'db.php';
if(isset($_POST['submit'])){
$st_name = $_POST['st_name'];
$st_id = $_POST['st_id'];
$st_email = $_POST['st_email'];
$query = "insert into student(`full_name`, `st_id`, `email`) values('$st_name', '$st_id', '$st_email')";
$return = mysql_query($query) or die(mysql_error());
header('location:student_list.php');
}
?>
<form method="post" action="">
<table>
<tr>
<td>Name</td>
<td>:</td>
<td><input type="text" name="st_name"></td>
</tr>
<tr>
<td>student id</td>
<td>:</td>
<td><input type="text" name="st_id"></td>
</tr>
<tr>
<td>Email</td>
<td>:</td>
<td><input type="text" name="st_email"></td>
</tr>
<tr>
<td></td>
<td></td>
<td><input type="submit" name="submit" value="Submit"></td>
</tr>
</table>
</form>