This commit is contained in:
Ruan 2015-07-09 08:13:28 +02:00
parent 722d3536b7
commit 2def96da36
2 changed files with 10 additions and 5 deletions

View File

@ -42,6 +42,7 @@ if (isset($_POST['name'], $_POST['table'])) {
} else {
echo('Banned permanently.');
}
echo("<br>");
}
}
?>

View File

@ -95,11 +95,15 @@ function print_table_headers($headers) {
}
function print_check_form($table) {
// var table=document.URL.substring(document.URL.lastIndexOf("/")+1); table=table.substring(0,table.indexOf("."));
echo('<br>');
echo('<form onsubmit="captureForm(event);" class="form-inline"><div class="form-group"><input type="text" class="form-control" id="user" placeholder="Player"></div><button type="submit" class="btn btn-default">Check</button></form>');
echo('<script type="text/javascript">function captureForm(b){$.ajax({type:"POST",url:"check.php",data:{name:document.getElementById("user").value,table:"' . $table . '"}}).done(function(c){document.getElementById("output").innerHTML=c});b.preventDefault();return false};</script>');
echo('<div id="output"></div>');
echo('
<div class="row">
<div style="margin-left: 15px;">
<form onsubmit="captureForm(event);" class="form-inline"><div class="form-group"><input type="text" class="form-control" id="user" placeholder="Player"></div><button type="submit" class="btn btn-default" style="margin-left: 5px;">Check</button></form>
</div>
<script type="text/javascript">function captureForm(b){$("#output").removeClass("in");$.ajax({type:"POST",url:"check.php",data:{name:document.getElementById("user").value,table:"' . $table . '"}}).done(function(c){document.getElementById("output").innerHTML=c;$("#output").addClass("in")});b.preventDefault();return false};</script>
<div id="output" class="success fade" data-alert="alert" style="margin-left: 15px;"></div>
</div>
');
}
?>