I'm trying to redirect from JS and include a variable that will be accessible via $_GET for PHP, like so:
let destination = "viewmode.php?id=" + id
window.location.href = destination;
Once I get to the PHP in the other page, this
print $_GET['id'];
Only raises error "Undefined index: id"
From the url I can tell that the variable exists... right?
...ne/viewmode.php?id=7
So,
1- Is it okay to pass a variable simply by modifying the url in JS?
2- Does PHP's $_GET method simply rely on the url to access the requested values?
If the answer to #2 is yes, then why can't PHP find the index "id"?
PS: I know I should be using if(isset($_GET['id'])
once I'm done debugging