-
Notifications
You must be signed in to change notification settings - Fork 1
/
databasing.html
76 lines (72 loc) · 1.75 KB
/
databasing.html
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
<html>
<head>
<script type="text/javascript">
function textBox(str1,str2)
{
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("results").innerHTML=xmlhttp.responseText;
}
else{
document.getElementById("results").innerHTML="status error: "+ xmlhttp.status;
}
}
xmlhttp.open("GET","textBox.php?Code="+str1+"&username="+str2,true); //
xmlhttp.send();
}
function textBoxGet(str1)
{
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("results").innerHTML="Loaded";
document.getElementById("Code").value=xmlhttp.responseText;
}
else{
document.getElementById("results").innerHTML="status error: "+ xmlhttp.status;
}
}
xmlhttp.open("GET","textBoxGet.php?username="+str1,true); //
xmlhttp.send();
}
</script>
</head>
<body>
<TABLE>
<TR>
<TD>
<p><textarea id="Code" name="Code" value="" >Enter your code here</textarea></p>
<p>Name: <input type="text" id="username" name="username" value=""></text></p>
<p><button onclick = "textBox(Code.value,username.value);" >Save Post</button></p>
<p><button onclick = "textBoxGet(username.value);" >Load Post</button></p>
</TD>
</TR>
<TR>
<TD>
</TD>
</TR>
</TABLE>
<div id="results" name="results"></div>
</body>
</html>