homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Auto Complete

 3:15 am on Jun 18, 2012 (gmt 0)

Can u please help me to have some codes for "auto-complete" in text-box that gets the data from the database

Tnx :)



 3:28 am on Jun 18, 2012 (gmt 0)

search "javascript auto-complete"


 4:53 am on Jun 18, 2012 (gmt 0)

Is there a code for this in PHP. I need to write it in PHP form :)


 3:54 pm on Jun 18, 2012 (gmt 0)

You can put Javascript into PHP files, but auto complete is a function of the browser, not server side programming, and the only access to the browser itself is via client side scripting - as said, Javascript (or VBscript.)


 12:52 pm on Jun 20, 2012 (gmt 0)

<script type="text/javascript">
function findmatch() {
if (window.XMLHttpRequest){
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById('results').innerHTML = xmlhttp.responseText;
xmlhttp.open('GET', 'search.inc.php?search_text='+document.search.search_text.value, true);
<form id="search" name="search">
Type a name:<br>
<input type="text" name="search_text" onkeyup="findmatch();">
<div id="results"></div>



if (isset($_GET['search_text'])) {
echo $search_text = $_GET['search_text'];

if (!empty($search_text)) {

if (mysql_connect('localhost','root','')) {
id (mysql_connect_db('a_database')) {

$query = "SELECT `firstname` FROM `names` WHERE `name` LIKE '".mysql_real_escape_string($search_test)."%'";
$query_run = mysql_query($query);

while ($query_row = mysql_fetch_assoc($query_run))
echo $name = $query_row['name'].'<br>';




 5:53 pm on Jun 27, 2012 (gmt 0)

Here's a start [jqueryui.com...]

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved