I am sending a request to my CI program from a remote javascript program running in a browser. The call on the javascript client is
Code:
var xhr = new XMLHttpRequest();
xhr.onerror = function() { alert('error'); };
xhr.addEventListener ("load", reqListener);
xhr.open('GET', 'http://localhost/Subit_backend/register', true); //used .htdaccess in apache server to modify the injection of index.php as per CI forum 3/17/18
myArray["email"]=jsonResponse["email"];
var json = JSON.stringify(myArray);
document.onreadystatechange = function () {
if (xhr.readyState===1)
{
xhr.send(json);
}
}
On the server side I have
PHP Code:
public function register()
{
if (isset($_GET["email"])) {
}
}
The controller fires and I have a breakpoint on the if (isset()) line. But isset never seems to catch the $_GET["email"]; it always fails. I am actually sending over three data items from the client in myArray, the email address, the Latitude and the longitude. How can I see what buffer is being received by the controller? Is there anything obvious I am missing?
proof that an old dog can learn new tricks