-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10.php
More file actions
61 lines (50 loc) · 1.21 KB
/
10.php
File metadata and controls
61 lines (50 loc) · 1.21 KB
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
<html>
<body>
<?php
$connect = mysqli_connect("localhost","root","root","student","8889");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
if(isset($_POST['submit']))
{
$usn=$_POST['usn'];
$name=$_POST['name'];
$email=$_POST['email'];
$mob=$_POST['mob'];
$s="insert into stud values('$usn','$name','$email','$mob')";
$ins=mysqli_query($connect,$s);
if($ins)
{
echo "<script>alert('Inserted Successfully');
window.location.href='10a.php';
</script>";
}
else
{
echo "<script>alert('Error in insertion');</script>";
}
}
?>
<form action="10.php" method="post">
<h1>Student Entry Form</h1>
<table>
<tr>
<td>USN</td><td><input type="text" name="usn"></td>
</tr>
<tr>
<td>Name</td><td><input type="text" name="name"></td>
</tr>
<tr>
<td>Email</td><td><input type="email" name="email"></td>
</tr>
<tr>
<td>Mobile Number</td><td><input type="number" name="mob"></td>
</tr>
<tr>
<td><input type="submit" name="submit" value="Register"></td>
<td><input type="reset" name="reset" value="Clear"></td>
</tr>
</table>
</form>
</body></html>