• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Jquery] Display problem? Modern AAC

Kavvson

Gdy boli cie glowa wez
Joined
Jun 25, 2008
Messages
1,177
Reaction score
72
Location
Poland
opa5bb.jpg


As you see the

PHP:
<div class="ui-widget">
	<label for="tags">Character name: </label>
	<input id="tags">
</div>

Part is displayed abnormally.. Why? Any ideas? The field is just declarated once in the /public/css/smoothness/jquery-ui-1.7.2.custom.css file.. Normally the width should stand like 100px? not 1500 :s


Regards
 
Its a simply demo.. But as you see the suggestion box got a huge width

HTML:
<link media="screen,print" type="text/css" href="<?PHP ECHO "".WEBSITE."" ?>/public/css/smoothness/jquery-ui-1.7.2.custom.css" rel="stylesheet">

<script type="text/javascript">
	$(function() {
		var availableTags = ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl"];
		$("#tags").autocomplete({
			source: availableTags
		});
	});
	</script>


	
<div class="demo">

<div class="ui-widget">
	<label for="tags">Character name: </label>
	<input id="tags">
</div>
</div>
 
Its a simply demo.. But as you see the suggestion box got a huge width

HTML:
<link media="screen,print" type="text/css" href="<?PHP ECHO "".WEBSITE."" ?>/public/css/smoothness/jquery-ui-1.7.2.custom.css" rel="stylesheet">

<script type="text/javascript">
	$(function() {
		var availableTags = ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl"];
		$("#tags").autocomplete({
			source: availableTags
		});
	});
	</script>


	
<div class="demo">

<div class="ui-widget">
	<label for="tags">Character name: </label>
	<input id="tags">
</div>
</div>

Then simply overwrite the css?

And why are u including the css file second time.
 
I have some next questions i hope you will help


1) Is this code safe?
2) How to connect with the Modern AAC database?



These are the files Show.php

PHP:
//connection information
	$host = "localhost";
	$user = "root";
	$password = "";
	$database = "mod";
	$param = $_GET["term"];
	$server = mysql_connect($host, $user, $password);
	$connection = mysql_select_db($database, $server);
	$query = mysql_query("SELECT name FROM players WHERE name REGEXP '^$param' LIMIT 30");
	
	
	for ($x = 0, $numrows = mysql_num_rows($query); $x < $numrows; $x++) {
		$row = mysql_fetch_assoc($query);
    
		$players[$x] = array("name" => $row["name"]);		
	}
	
	
	$response = $_GET["characters"] . "(" . json_encode($players) . ")";
	echo $response;
	
	mysql_close($server);

And the injection

PHP:
<?PHP
if ( !defined( 'BASEPATH' ) ) exit( 'No direct script access allowed' );
require("config.php");

?>

<script>
$(function(){
				
				
				$("#search").autocomplete({
					
					
					
					source: function(req, add){
					
					
						
						$.getJSON("/show.php?characters=?", req, function(data) {
							
							
							var suggestions = [];
							
							
							$.each(data, function(i, val){								
								suggestions.push(val.name);
							});
							
							
							
							add(suggestions);
						});
						
					},
					
				});
			});
			
		function fill(thisValue) {
		$('#search').val(thisValue);

	}
			</script>
<label>Character name</label>

<div id="characters" class="ui-helper-clearfix">
<input id="search" type="text" onblur="fill();">
</div>
					
<input type='submit' value='Search'>
</form>

3) Is it possible to change the directory somehow? Or make the whole show.php part in injection.php?

HTML:
$.getJSON("/show.php?characters=?", req, function(data) {

PHP:
/show.php?characters=?
is displayed as
PHP:
http://127.0.0.1/show.php?characters=jsonp1275237080276&term=kavvson

Should be in a other directory since i run it from http://127.0.0.1/trunk.r123/ and it should be taken from the injection folder not the main folder

4) The search button dont work ^^
 
I have some next questions i hope you will help


1) Is this code safe?
2) How to connect with the Modern AAC database?



These are the files Show.php

PHP:
//connection information
	$host = "localhost";
	$user = "root";
	$password = "";
	$database = "mod";
	$param = $_GET["term"];
	$server = mysql_connect($host, $user, $password);
	$connection = mysql_select_db($database, $server);
	$query = mysql_query("SELECT name FROM players WHERE name REGEXP '^$param' LIMIT 30");
	
	
	for ($x = 0, $numrows = mysql_num_rows($query); $x < $numrows; $x++) {
		$row = mysql_fetch_assoc($query);
    
		$players[$x] = array("name" => $row["name"]);		
	}
	
	
	$response = $_GET["characters"] . "(" . json_encode($players) . ")";
	echo $response;
	
	mysql_close($server);

And the injection

PHP:
<?PHP
if ( !defined( 'BASEPATH' ) ) exit( 'No direct script access allowed' );
require("config.php");

?>

<script>
$(function(){
				
				
				$("#search").autocomplete({
					
					
					
					source: function(req, add){
					
					
						
						$.getJSON("/show.php?characters=?", req, function(data) {
							
							
							var suggestions = [];
							
							
							$.each(data, function(i, val){								
								suggestions.push(val.name);
							});
							
							
							
							add(suggestions);
						});
						
					},
					
				});
			});
			
		function fill(thisValue) {
		$('#search').val(thisValue);

	}
			</script>
<label>Character name</label>

<div id="characters" class="ui-helper-clearfix">
<input id="search" type="text" onblur="fill();">
</div>
					
<input type='submit' value='Search'>
</form>

3) Is it possible to change the directory somehow? Or make the whole show.php part in injection.php?

HTML:
$.getJSON("/show.php?characters=?", req, function(data) {

PHP:
/show.php?characters=?
is displayed as
PHP:
http://127.0.0.1/show.php?characters=jsonp1275237080276&term=kavvson

Should be in a other directory since i run it from http://127.0.0.1/trunk.r123/ and it should be taken from the injection folder not the main folder

4) The search button dont work ^^

Come one.. I need it :(

Btw it looks like this now :) soon will be published if you help some

2u62243.jpg
 
1. Use internal sql system!!!!!
2. Just print them with a new line (\n) as seperation and use:
$("#search").autocomplete('/show.php?characters=?');

directly.

3. In it's standalone form it's absolutly not safe.
 
1. Use internal sql system!!!!!
2. Just print them with a new line (\n) as seperation and use:


directly.

3. In it's standalone form it's absolutly not safe.

1/2 points i cant get it .. example?
3. So how to?

PHP:
<?PHP
if ( !defined( 'BASEPATH' ) ) exit( 'No direct script access allowed' );
require("config.php");
?>
<script>
$(function(){
				//attach autocomplete
				$("#search").autocomplete({
					//define callback search format results
					source: function(req, add){
						//pass request search server

						$.getJSON("/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>
<form action="index.php/character/view" method="post" class="search">
<div id="characters" class="ui-helper-clearfix">
<input id="search" type="text" onblur="fill();">&nbsp &nbsp &nbsp <button type='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">&nbsp Search &nbsp</span></button>
</div>
</div>
</form>

Charactersearch.php

PHP:
<?php
echo form_open("character/view");
?>

<?php 
	$ide = new IDE;
	try {
		$ide->loadInjections("character_search");
	}
		catch(Exception $e) {
			error($e->getMessage());
		}
	

?>
 
Back
Top