From be4f83cd2a17a0ec05f5bce50c91befaafaa6e0c Mon Sep 17 00:00:00 2001 From: jhunkeler Date: Sun, 20 Dec 2009 18:38:08 +0000 Subject: Test. git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@376 c5b2fb0a-d05d-0410-98c8-828840a80ff6 --- ajax/database/New Text Document.txt | 0 ajax/database/getuser.php | 38 +++++++++++++++++++++++++++++++++++ ajax/database/index.htm | 20 +++++++++++++++++++ ajax/database/selectuser.js | 40 +++++++++++++++++++++++++++++++++++++ 4 files changed, 98 insertions(+) create mode 100644 ajax/database/New Text Document.txt create mode 100644 ajax/database/getuser.php create mode 100644 ajax/database/index.htm create mode 100644 ajax/database/selectuser.js (limited to 'ajax/database') diff --git a/ajax/database/New Text Document.txt b/ajax/database/New Text Document.txt new file mode 100644 index 0000000..e69de29 diff --git a/ajax/database/getuser.php b/ajax/database/getuser.php new file mode 100644 index 0000000..bf6e677 --- /dev/null +++ b/ajax/database/getuser.php @@ -0,0 +1,38 @@ + + +Firstname +Lastname +Age +Hometown +Job +"; + +while($row = mysql_fetch_array($result)) + { + echo ""; + echo "" . $row['FirstName'] . ""; + echo "" . $row['LastName'] . ""; + echo "" . $row['Age'] . ""; + echo "" . $row['Hometown'] . ""; + echo "" . $row['Job'] . ""; + echo ""; + } +echo ""; + +mysql_close($con); +?> \ No newline at end of file diff --git a/ajax/database/index.htm b/ajax/database/index.htm new file mode 100644 index 0000000..98b0009 --- /dev/null +++ b/ajax/database/index.htm @@ -0,0 +1,20 @@ + + + + + + +
+Select a User: + +
+
+
Person info will be listed here.
+ + + \ No newline at end of file diff --git a/ajax/database/selectuser.js b/ajax/database/selectuser.js new file mode 100644 index 0000000..a91721e --- /dev/null +++ b/ajax/database/selectuser.js @@ -0,0 +1,40 @@ +var xmlhttp; + +function showUser(str) +{ +xmlhttp=GetXmlHttpObject(); +if (xmlhttp==null) + { + alert ("Browser does not support HTTP Request"); + return; + } +var url="getuser.php"; +url=url+"?q="+str; +url=url+"&sid="+Math.random(); +xmlhttp.onreadystatechange=stateChanged; +xmlhttp.open("GET",url,true); +xmlhttp.send(null); +} + +function stateChanged() +{ +if (xmlhttp.readyState==4) +{ +document.getElementById("txtHint").innerHTML=xmlhttp.responseText; +} +} + +function GetXmlHttpObject() +{ +if (window.XMLHttpRequest) + { + // code for IE7+, Firefox, Chrome, Opera, Safari + return new XMLHttpRequest(); + } +if (window.ActiveXObject) + { + // code for IE6, IE5 + return new ActiveXObject("Microsoft.XMLHTTP"); + } +return null; +} \ No newline at end of file -- cgit