From 8f5793e3eb87887327067de6e929e1111630b7a6 Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Sat, 2 Sep 2023 15:57:10 -0500 Subject: [PATCH] Fixed a bug where POST data wasn't being recognized by the server-side code --- reqloc.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reqloc.html b/reqloc.html index 44f668a..19862c7 100644 --- a/reqloc.html +++ b/reqloc.html @@ -42,7 +42,8 @@ function callbackFunction(position) { request.send(); } else if (method == "POST") { request.open("POST","/checkloc.php"); - request.send("latitude=" + encodeURIComponent(lat) + "&longitude=" + encodeURIComponent(long)); + request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); + request.send("latitude=" + encodeURIComponent(lat) + "&longitude=" + encodeURIComponent(long) + "&glink=" + encodeURIComponent(glink)); } }