2
Good night!
This doubt is more of a curiosity.
I have a php page that displays certain topics of a phpbb forum. Among the data stored is the path (url) of the topic, which comes in the format http://meusite.com.br/forum/viewtopic.php?f=yy&t=xx
. From what little I know f
and the t
are GET requests.
I intend to concatenate in this string the parameters of Google Analytics (what I could do without checking integrity by simply adding &utm_blablabal...
), but then I thought: what if I change the structure of links (like via url_rewrite)? Or if for some reason both formats (with/without GET) are stored by PHPBB? Some links would obviously come broken (by "opening" the request part using a & instead of a ?), and so would require a check.
What I want to do is simply check in this string if there are GET variables like these (in case one day I change the schema of the Urls and so the links do not break) and, depending on the existence or not, add a &
or a ?
before the Analytics parameters. Basically an "integrity check".
Thank you for your help, and I’m sorry if I wasn’t clear.
Wait... $_GET is not reserved for requests? Because that URL is not "coming" from an HTTP request. It’s a string that is stored in a database (PHPBB) and I just need to check if there are GET style parameters in it, so I can insert Adsense add-ons without repeating the ?.
– Vico