Jquery autocomplete with php source

atn91

New Member
I would like to use the jquery autocomplete "function" with a php file as the source. I don't get why it is not working. If I use data entered in a variable everything works fine. Hope someone can help. Thank you in advance for your replies. Cheers. Marc.My HTML:\[code\]<input id="moi" type="text"/>\[/code\]My JS :\[code\]$(function() { $( "#moi" ).autocomplete({ source: "php/search_loc.php", minLength: 2 }); });\[/code\]My PHP:\[code\]<?phpheader('Content-Type: text/html; charset=utf-8');require("../inc/connect.inc.php");mysql_set_charset('utf8'); $result = mysql_query("SELECT * FROM search_loc");$row=mysql_fetch_assoc($result);while($row=mysql_fetch_assoc($result)){ echo $row['srl_loc'].'<br>';}?>\[/code\]
 
Top