-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtesting.php
111 lines (104 loc) · 3.29 KB
/
testing.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php require_once('Connections/HMS.php'); ?>
<?php
mysql_select_db($database_HMS, $HMS);
$query_personRS = "SELECT * FROM person";
$personRS = mysql_query($query_personRS, $HMS) or die(mysql_error());
$row_personRS = mysql_fetch_assoc($personRS);
$totalRows_personRS = mysql_num_rows($personRS);
?>
<?php
function hello()
{
global $a ;
$a = "Hello";
echo $a;
}
?>
<script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
<script type="text/javascript">
function echoHello()
{
alert("<?php hello(); ?>");
}
function performAction(action) {
// ASSIGN THE ACTION
var action = $('#fName').val();
//alert("My First JavaScript");
//alert(action);
var phone="12345678";
var id="23";
$.ajax({
url: 'test/do.php?param=xyz&fname='+action,
success: function(data) {
$('#action1').html(data);
//alert('Load was performed.');
}
});
/*$("#action").load("prenos.php?number="+phone+"&id="+id,function() {
var reciverParameters = $("#action").html();
var parser = new Array();
parser = reciverParameters.split(",");
alert(parser);
});*/
// UPDATE THE HIDDEN FIELD
//document.getElementById("action").value = action;
//alert("<?php hello(); ?>");
// SUBMIT THE FORM
//document.adminform.submit();
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<form id="adminform" action="" method="GET">
<body>
<table align="center">
<tr valign="baseline">
<td> First Name: <input id="fName" type="text" name="fName" size="32" /></td>
<td> Middle Name:<input type="text" name="mName" value="" size="32" /></td>
<td> Last Name:<input type="text" name="lName" value="" size="32" /></td>
</tr>
<tr>
<td>
<input type="button" onClick="performAction('showValue');" value="Search" />
<input type="hidden" id="action" name="action" value="" />
</td>
</tr>
<tr>
<td>
<input type="button" onClick="echoHello();" value="Say Hello" />
</td>
</tr>
<tr>
<table border="1">
<tr>
<td>Name</td>
<td>mobile</td>
<td>DOB</td>
</tr>
<?php while ($row_personRS = mysql_fetch_assoc($personRS))
{ ?>
<tr>
<td><?php echo $row_personRS['fName']; ?></td>
<td><?php echo $row_personRS['mobile']; ?></td>
<td><?php echo $row_personRS['DOB']; ?></td>
</tr>
<?php } ?>
</table>
</tr>
</table>
<div id="action1">
Test
</div>
<script>
/*$("#fName").bind('input', function() {
performAction('test');
//alert(e);
});
</script>*/
</body>
</form>
</html>