Modern AAC - JSON/PHP - Injection
How can i merge the 2 files?
Show.php How to reconvert it into one file the both files. How can i merge them and pass the standalone sql connection.
and
Injection.php
in one file.. since it get some troubles while making
How can i merge the 2 files?
Show.php How to reconvert it into one file the both files. How can i merge them and pass the standalone sql connection.
PHP:
<?php
//connection information
$host = "localhost";
$user = "root";
$password = "";
$database = "mod";
$param = $_GET["term"];
//make connection
$server = mysql_connect($host, $user, $password);
$connection = mysql_select_db($database, $server);
//query the database
$query = mysql_query("SELECT name FROM players WHERE name REGEXP '^$param' LIMIT 30");
//build array of results
for ($x = 0, $numrows = mysql_num_rows($query); $x < $numrows; $x++) {
$row = mysql_fetch_assoc($query);
$players[$x] = array("name" => $row["name"]);
}
//echo JSON to page
$response = $_GET["characters"] . "(" . json_encode($players) . ")";
echo $response;
mysql_close($server);
?>
and
Injection.php
HTML:
<?PHP
if ( !defined( 'BASEPATH' ) ) exit( 'No direct script access allowed' );
global $config;
?>
<script>
$(function(){
//attach autocomplete
$("#search").autocomplete({
//define callback search format results
source: function(req, add){
//pass request search server
$.getJSON("http://127.0.0.1/trunk.r123/injections/character_search/Autocomplete/show.php?characters=?", req, function(data) {
//create array for response objects
var suggestions = [];
//process response
$.each(data, function(i, val){
suggestions.push(val.name);
});
//pass array search callback
add(suggestions);
});
},
});
});
function fill(thisValue) {
$('#search').val(thisValue);
}
</script>
<style type="text/css">
#resizable { width: 97%; height: 100px; padding: 0.5em; }
#resizable h3 { text-align: center; margin: 0; height 10px;}
</style>
<div id="resizable" class="ui-widget-content">
<h3 class="ui-widget-header">Search Character</h3>
<br>
<label>Character name</label>
<div id="characters" class="ui-helper-clearfix">
<input id="search" name="name" type="text" onblur="fill();">      <button type="submit" name="Submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false"><span class="ui-button-text">  Search   </span></button>
</form>
</div>
</div>
in one file.. since it get some troubles while making
Last edited: