-
Notifications
You must be signed in to change notification settings - Fork 0
/
showPersons.php
91 lines (77 loc) · 1.56 KB
/
showPersons.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
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
<html>
<body>
<?php
$myperson="";
if ($db_conn=OCILogon("ora_i0r7", "a41671785", "ug")){
echo "Connected to Oracle". "<br />";
$cmdstr = "select name, email, password from person";
$parsed = OCIParse($db_conn,$cmdstr);
if (!$parsed){
$err = OCIError($db_conn);
echo htmlentities($err['message']);
exit;
}
$r=OCIExecute($parsed, OCI_DEFAULT);
if(!$r){
$err = oci_error($parsed);
echo htmlentities($err['message']);
exit;
}
// echo "<br /> Data Retrieved <br />";
/**
while($row = OCI_Fetch_Array($parsed, OCI_BOTH)){
echo $row["NAME"];
echo "\n";
echo $row[1];
echo "<br />";
}
**/
?>
<form method="post" action="setGlobalUser.php">
<select name="selectUser">
<option value=""></option>
<?php
while($row = OCI_Fetch_Array($parsed, OCI_BOTH)){
?>
<option value="<?php echo $row[1] ?>" > <?php echo $row[0] ?> </option>
<?php
$username[$row[1]] =$row[0];
$userpasswd[$row[1]] =$row[2];
}
?>
</select>
<input type="submit" value="Set User"><br/>
Password:
<input type="password" size =10" name="pwd" value="password">
</form>
<?php
//echo "Current User = ";
//echo $GLOBALS["SelectedUser"];
$myperson=$GLOBALS["SelectedUser"];
//echo "<br />";
OCILogoff($db_conn);
}else{ // logon succesful
$err = OCIError();
echo htmlentities($err['message']);
}
?>
<?php
/**
foreach ($username as $key => $value) {
echo $key ;
echo $value ;
echo "<br />";
}
foreach ($userpasswd as $key => $value) {
echo $key ;
echo $value ;
echo "<br />";
}
*/
?>
<?php
echo "USERID = $myperson ";
?>
<br />
</body>
</html>