Skip to content

Commit

Permalink
First Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Koushik Biswas committed May 21, 2017
0 parents commit f7fe2b0
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
6 changes: 6 additions & 0 deletions calldatastore.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
date_default_timezone_set('UTC');
$timenow = date('l jS \of F Y h:i:s A');
$queryval = $_GET['searchtext'] . ' ' . $timenow;
echo $queryval;
?>
69 changes: 69 additions & 0 deletions form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function OnInput (event) {
var textdata = event.target.value;
var phpurl = 'calldatastore.php?searchtext=' + textdata;
getRequest(
phpurl,
drawOutput,
drawError
);
}
function drawError() {
var container = document.getElementById('output');
container.innerHTML = 'Oops, there was an error';
}
function drawOutput(responseText) {
var container = document.getElementById('output');
container.innerHTML = responseText;
}
function getRequest(url, success, error) {
var req = false;
try{
// most browsers
req = new XMLHttpRequest();
} catch (e){
// IE
try{
req = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
// try an older version
try{
req = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
return false;
}
}
}
if (!req) return false;
if (typeof success != 'function') success = function () {};
if (typeof error!= 'function') error = function () {};
req.onreadystatechange = function(){
if(req.readyState == 4) {
return req.status === 200 ?
success(req.responseText) : error(req.status);
}
}
req.open("GET", url, true);
req.send(null);
return req;
}
// Internet Explorer
//function OnPropChanged (event) {
// if (event.propertyName.toLowerCase () == "value") {
// alert ("The new content: " + event.srcElement.value);
// }
//}
</script>
</head>
<body>
<form action="upload.php" method="post" enctype="multipart/form-data" style="font-family:Tahoma">
Type your search text here:<br/><br/>
<input type="text" oninput="OnInput(event);" onpropertychange="OnPropChanged(event);" autofocus><br/>
<br/>
<div id="output" style="border: 1px solid black">Watch out for AJAX output here</div>
</form>
</body>
</html>

0 comments on commit f7fe2b0

Please sign in to comment.