I'm trying to work the Auto suggestion in Ajax.
It works well in my local computer, but doesn't work online.
I think XMLHttpRequest doesn't seem work properly, but not sure about that.
Please help me if any expert coders has any advices.

remotesuggestion.js

/**
* Provides suggestions for state names (USA).
* @class
* @scope public
*/
function RemoteStateSuggestions() {

/*
if (typeof XMLHttpRequest != "undefined") {
this.http = new XMLHttpRequest();
} else if (typeof ActiveXObject != "undefined") {
//this.http = new ActiveXObject("MSXML2.XmlHttp");
this.http = new ActiveXObject("Microsoft.XMLHTTP");
} else {
alert("No XMLHttpRequest object available. This functionality will not work.");
}
*/
if (window.XMLHttpRequest) {
this.http = new XMLHttpRequest();
} else if (window.ActiveXObject) {
this.http = new ActiveXObject("Microsoft.XMLHTTP");
} else {
this.http = null;
}
}

/**
* Request suggestions for the given autosuggest control.
* @scope protected
* @param oAutoSuggestControl The autosuggest control to provide suggestions for.
*/
RemoteStateSuggestions.prototype.requestSuggestions = function (oAutoSuggestControl /*:AutoSuggestControl*/,
bTypeAhead /*:boolean*/) {

var oHttp = this.http;

//if there is already a live request, cancel it
if (oHttp.readyState != 0) {
oHttp.abort();
}
// var abc = encodeURIComponent(oAutoSuggestControl.textbox.value);
//alert(oAutoSuggestControl.textbox.value);
//build the URL
var sURL = "suggestionsMyPaper.php?userInput=" + encodeURIComponent(oAutoSuggestControl.textbox.value);

//open connection to states.txt file
oHttp.open("get", sURL , true);

oHttp.onreadystatechange = function () {
if (oHttp.readyState == 4) {
//evaluate the returned text JavaScript (an array)
var aSuggestions = eval(oHttp.responseText);
alert(aSuggestions);
//provide suggestions to the control
oAutoSuggestControl.autosuggest(aSuggestions, bTypeAhead);
}
}

//oHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
oHttp.send("");
}
suggestions.php
<?php
header("Content-Type: text/plain; charset=UTF-8");

include("services/AutosuggestionService.php");

session_start();
$global_uni = $_SESSION['global_uni'];
$global_id = $_SESSION['global_id'];

$service = new AutosuggestionService;
$result = $service->CheckPapers($global_uni);

while ($ob = mysql_fetch_object($result)) {
$states[] = $ob->paper_code;
}


$suggestions = array();

if (strlen($userInput) > 0){

$userInputLC = strtolower($userInput);

for ($i=0; $i < count($states); $i++) {

$stateLC = strtolower($states[$i]);

$result = strpos($stateLC, $userInputLC);
if ($result !== false && $result == 0) {
array_push($suggestions, $userInput.substr($states[$i], strlen($userInput)));
}
}
}
?>
[<?php
for ($i = 0; $i < count($suggestions); $i++) {
if ($i > 0) {
echo ",";
}
echo "\"".$suggestions[$i]."\"";

}
?>]
Any solution will be very appreciated!!
Thanks