It depends on the what the data is for, its type and its length. Usually, passing variables in the query string is fine.
Be aware that when accepting mutable parameters, you need to verify they are what you expect them to be. For example, I could change ?id=5
to ?id=hello
and possibly break your application. To remedy this, we could typecast the ID to an integer:
$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;