Hi Guys. I have a ajax.php at C://xampp/htdocs/myWebsite/autocomplete/ajax.php where all the queries and data retrieved from MySQL are stated in here. Then I have a auto.js at C://xampp/htdocs/myWebsite/autocomplete/js/auto.js auto.js: $('#countryname_1').autocomplete({ source: function( request, response ) { $.ajax({ url : 'ajax.php', dataType: "json", data: { name_startsWith: request.term, type: 'country_table', row_num : 1 }, success: function( data ) { response( $.map( data, function( item ) { var code = item.split("|"); return { label: code[0], value: code[0], data : item } })); } }); }, autoFocus: true, minLength: 0, select: function( event, ui ) { var names = ui.item.data.split("|"); console.log(names[1], names[2], names[3]); $('#country_no_1').val(names[1]); $('#phone_code_1').val(names[2]); $('#country_code_1').val(names[3]); } }); Code (markup): my index.php is in C://xampp/htdocs/myWebsite/ABC/index.php Any idea how should url: 'ajax.php' Code (markup): be? I tried url: '../autocomplete/ajax.php' Code (markup): but to no avail.
Technically, if your site is at ABC/, the rest of the folders and files should be subfolders to that folder - normally, on a production server, this will be root, and accessing folders above root is NOT recommended, and might not even be possible