Problem with $_GET method

Hello i have a strange problem with $_GET method, i created the method with this code in JS :

function qget () {

  var data = new URLSearchParams();
  var DateStart  = Digit.join("");
  //DateStart = DateStart.substr(2, 3);
  data.append("Dates",DateStart);
  data.append("Intervalle", Intervalle);
  data.append("Base", DB);
  data.append("Checkboxes",Boxes);
  // (B) URL + REDIRECT
  var url = "index.php?" + data.toString();
  location.href = url;
}

and i have this result on the navigation bar :


So i have all my variable names and values then i have the following code to load the values :

if(isset($_GET["Base"])) {$DB = $_GET["Base"];} // get Date from HTTP GET
else {$DB="Locale";}	

$Intervalle = !empty( $_GET['Intervalle'] ) ? intval( $_GET['Intervalle'] ) : 30;

if(isset($_GET["Checkboxes"])) {$Checkboxes = $_GET["Checkboxes"];} 
else {$Checkboxes="checkboxAcheckboxBcheckboxC";}//Choose A,B,C by defaut

So the result is working with variable name $Intervalle and $Base but not with $Checkboxes, it’s always passing to the else choice as it didn’t find the variable $Checkboxes. If someone can understand why ? Thanks

Hum by looking a little, i think my problem is with the mix Javascript and PHP was confuse and because localStorage is contained in user’s browser, and PHP is running on server.And in fact my $_GET was looking like working but not really sure now.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.