As far as I'm aware, a question mark in a URL always starts the query string, so just looking for the existence should do the trick.