-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert.php
More file actions
94 lines (60 loc) · 1.92 KB
/
Copy pathinsert.php
File metadata and controls
94 lines (60 loc) · 1.92 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
include("config.php");
$result=mysqli_query($mysql," SELECT * FROM registrations ORDER by id DESC");
?>
<!DOCTYPE html>
<head>
<title>Form</title>
</head>
<link rel="stylesheet" href="style.css">
<body>
<form action = "function.php" method="POST">
<div class="container">
<h1>Create Account</h1>
<input type="text" placeholder="Enter Name" name="name" id="name" required>
<input type="email" placeholder="Enter Email(username@iitk.ac.in)" name="email" id="email" pattern=".+@iitk.ac.in" required>
<input type="text" placeholder="Enter Mobile no." name="mobile" id="mobile" pattern="[789][0-9]{9}" required>
<input type="text" placeholder="Enter Address" name="address" id="address" required>
<div class="btn">
<button type="submit" name="submit" id ="submit" >Submit</button>
</div>
</div>
</form>
<table >
<tr>
<th>Name</th>
<th>Email</th>
<th>Mobile no</th>
<th>Address</th>
</tr>
<?php
while($res=mysqli_fetch_array($result))
{
echo '<tr>';
echo '<td>'.$res['name'].'</td>';
echo '<td>'.$res['email'].'</td>';
echo '<td>'.$res['mobile'].'</td>';
echo '<td>'.$res['address'].'</td>';
echo '</tr>';
}
?>
</table>
<script type ="text/javascript">
console.log("hiii");
function validate()
{
var text = document.getElementById("mobile").ariaValueMax;
console.log("in funct");
var regx = /^\d{10}$/;
if(regx.test(text))
{
console.log("correct");
}
else{
document.getElementById("submit").style.visibility="invisible";
alert("incorrect mobile number");
}
}
</script>
</body>
</html>