-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert_data.php
More file actions
38 lines (31 loc) · 953 Bytes
/
insert_data.php
File metadata and controls
38 lines (31 loc) · 953 Bytes
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
<html>
<head><title>Oracle demo</title></head>
<body>
<form action="insert_data.php" method="post">
ID: <input type="text" name="id"><br>
Name: <input type="text" name="name"><br>
Username: <input type="text" name="uname"><br>
Password: <input type="text" name="pass"><br>
<input type="submit">
</form>
<?php
$conn=oci_connect("project","pass","localhost/nas");
$id=$un=$n=$p="";
//$show= false;
if(isset($_POST['uname']) && isset($_POST['pass']) && isset($_POST['id']) && isset($_POST['name']))
{
$un=$_POST['uname'];
$p=$_POST['pass'];
$n=$_POST['name'];
$id=$_POST['id'];
//$show=true;
//echo $p;
}
$query="INSERT INTO PERSON (ID,NAME,USERNAME, PASSWORD) VALUES
('$id','$n','$un', '$p')";
$stmnt=oci_parse($conn,$query);
$result=oci_execute($stmnt);
oci_close($conn);
?>
</body>
</html>